Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. def string_input():
  2. good_value = ''
  3. while (good_value.isalpha() == False):
  4. print("Please enter a string, letters A-Z only.")
  5. print("Numbers, special characters and spaces will be rejected.")
  6. good_value = input()
  7. return good_value.lower()
  8. string = string_input()
  9. alphabet = [
  10. 'a','b','c','d','e','f','g','h','i','j','k','l','m',
  11. 'n','o','p','q','r','s','t','u','v','w','x','y','z'
  12. ]
  13. for i in range (len(alphabet)):
  14. print(alphabet[i], ': ', string.count(alphabet[i]), sep='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement