+ 1
write a program in python to find number of uppercase and lowercase letter in a string.
Please answer this question..
6 Antworten
+ 1
a=input("entet string:")
c1=0
c2=0
for i in a:
if i.isupper():
c1+=1
elif i.islower():
c2+=1
print("uppercase:",c1)
print("lowercase",c2)
+ 3
string = input ("Enter string:")
count1 = 0
count2 = 0
for i in string:
if(i.islower ()):
count1 = count1+1
elif(i.isupper ()):
count2 = count2+1
print("The number of lowercase characters is:")
print(count1)
print("The number of uppercase characters is:")
print(count2)
#my attempt
+ 3
guru randhawa Well done
+ 2
Try first and show your attempts if getting problem.
0
var = "PyThon"
lower = 0
upper = 0
for i in var:
if i.islower():
lower+=1
elif i.isupper():
upper+=1
print("uppercase : ",upper)
Print(" lowercase : ",lower)
0
Ty 🤗❤️