1234567891011121314151617181920212223 |
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- #déclare la variable sentence comme une chaîne de caractères
- sentence = "Je vois la vie en rose…"
- print("phrase de départ :",sentence)
- #converti sentence en liste
- words = sentence.split()
- print(words)
- #retirer les a, e, i, o, u et y de chaque mot
- for word in words:
- word=word.replace("a","")
- word=word.replace("e","")
- word=word.replace("i","")
- word=word.replace("o","")
- word=word.replace("u","")
- word=word.replace("y","")
- print(word)
- #reformer la phrase
- print("phrase sans les voyelles", " ".join(words))
|