Write a program that reads a line and print its statistics | Python | Code Caption

Published: 04 September 2022
on channel: Code Caption
305
3

#Ques 2. Write a program that reads a line and print its statistics data like number of uppercase letter
#etc.

#Soln :

line= input('Enter a line')

lowercount=uppercount=0
digitcount=alphacount=0

for a in line :
if a.islower():
lowercount+=1
elif a.isupper():
uppercount+=1
elif a.isdigit():
digitcount+=1
elif a.isalpha():
alphacount+=1



print("The number of Lowercase letters are",lowercount)
print("The number of Uppercase letters are",uppercount)
print("The number of Digits are",digitcount)
print("The number of Alphabets are",alphacount)


On this page of the site you can watch the video online Write a program that reads a line and print its statistics | Python | Code Caption with a duration of hours minute second in good quality, which was uploaded by the user Code Caption 04 September 2022, share the link with friends and acquaintances, this video has already been watched 305 times on youtube and it was liked by 3 viewers. Enjoy your viewing!