Problem 20

3 comments on “Problem 20”


  • Sreeja

    def charcounter(fname):
    linecount=0
    charcount=0
    with open(fname,’r’) as f:
    lines1=f.readlines()
    linecount=len(lines1)
    for i in lines1:
    for k in i:
    if k!=” ” or k!=”\n”:
    charcount+=1
    return linecount,charcount


  • Pallipattu

    Python
    n=input()
    a=0
    for i in n:
    if i.islower():
    a=a+1
    elif i.isupper():
    a=a+1
    else:
    if i.isdigit():
    a=a+1
    print(a)


  • Pallipattu

    n=input()
    a=0
    for i in n:
    if i.islower():
    a=a+1
    elif i.isupper():
    a=a+1
    else:
    if i.isdigit():
    a=a+1
    print(a)