Write a python program to check upper and lower case letters in a string.
str1=input("Enter the string")
print(str1)
uprcase=0
lwrcase=0
i=0
while(i<len(str1)):
if(str1[i].islower()==True):
lwrcase+=1
if(str1[i].isupper()==True):
uprcase+=1
i+=1
print("No of upper case letters in the string=",uprcase)
print("No of lower case letters in the string=",lwrcase)
Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands as a successor of a language called ABC.
Comments
Post a Comment