suite_de_lettres_texte_NE-MARCHE-PAS~20171216-180115.py 486 B

123456789101112131415161718192021222324
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. with open("novel_starring_you.txt", "a") as sentence:
  4. new_letter = []
  5. words = sentence.split()
  6. # for each word
  7. for word in words:
  8. # iterate over letters of word
  9. for letter in word:
  10. new_letter.append(letter)
  11. #print(new_letter)
  12. print("texte sans espaces:", "".join(new_letter))
  13. #for letter in new_letter:
  14. # new_letter = letter.sort(" ")
  15. new_letter.sort()
  16. #print(new_letter)
  17. print("suite de lettres", "".join(new_letter))