123456789101112131415161718192021 |
- list_voyelles=["a", "e", "é", "è", "ë", "ê", "i", "ï", "o", "u", "ù", "y"]
- new_words = []
- with open("entree.txt","r") as source:
- for line in source:
- words = line.split()
- for word in words:
- for v in list_voyelles:
- word = word.replace(v,"")
- new_words.append(word)
- print("phrase sans les voyelles :", " ".join(new_words))
- with open("phrase.txt","w") as destination:
- destination.write(" ".join(new_words))
|