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 Log in to Reply
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) Log in to Reply
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) Log in to Reply
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
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)
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)