Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1.  
  2.  
  3. def comptage():
  4. alpha = {chr(i + 64) for i in range(1, 27)}
  5. alpha = str(alpha)
  6. alphabet = alpha.lower()
  7. phrase = "Il fait beau ce matin a Tours"
  8. phrase = phrase.replace(" ", "")
  9. phrasE = phrase.lower()
  10. dictio = {}
  11.  
  12. for elem in alphabet:
  13. if (phrasE.count(elem)):
  14. dictio[elem] = phrasE.count(elem)
  15. print(dictio)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement