Nội dung text count words letter__docx.pdf
Telegram | YoutubeChannel :- NewIdeasYT यह FREE PDF WWW.EXAMJILA.COM से डाउनलोड की गयी है| write a program that takes in a sentence as input and displays the number of words, capital letters , small letters and special symbols. string = input("Please Enter your Own String : ") salpha = calpha = words = special = 0 for i in range(len(string)): if(string[i].isupper()): calpha = calpha + 1 elif(string[i].islower()): salpha = salpha + 1 elif(string[i]==" "): words = words + 1 else: special = special + 1 print("\nTotal Number of Small Alphabets : ", salpha) print("Total Number of Capital Alphabets : ", calpha) print("Total Number of Special Characters in this String : ", special) print("Total Number of words: ", words+1)