123456789101112131415161718192021222324 |
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- with open("novel_starring_you.txt", "a") as sentence:
- new_letter = []
- words = sentence.split()
- # for each word
- for word in words:
- # iterate over letters of word
- for letter in word:
- new_letter.append(letter)
- #print(new_letter)
- print("texte sans espaces:", "".join(new_letter))
- #for letter in new_letter:
- # new_letter = letter.sort(" ")
- new_letter.sort()
- #print(new_letter)
- print("suite de lettres", "".join(new_letter))
|