Advertisement
xah

W: Letters

xah
Mar 29th, 2017 (edited)
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. s = input().upper()
  2.  
  3. while s:
  4.     if s == '#':
  5.         break
  6.  
  7.     # s[0] is the letter
  8.  
  9.     output = 0
  10.  
  11.     for ss in s[1:]:
  12.         if ss == s[0]:
  13.             output += 1
  14.  
  15.     print(output)
  16.  
  17.     s = input().upper()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement