Advertisement
mrfeedoz

str(4)

Dec 7th, 2022
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. text = input()
  2. lenght = len(text)
  3. count_lower = 0
  4. count_upper = 0
  5.  
  6. for i in range(lenght):
  7.     if (text[i].islower()):
  8.         count_lower += 1
  9.     elif (text[i].isupper()):
  10.         count_upper += 1
  11.  
  12. count_all = count_lower + count_upper
  13. proc_upper = count_upper * 100 / count_all
  14. proc_lower = count_lower * 100 / count_all
  15.  
  16. print(f"{proc_upper:.2f}%")
  17. print(f"{proc_lower:.2f}%")
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement