Files
ola5doc/output/sources/phrase_sans_espaces2.py
T

23 lines
421 B
Python

#!/usr/bin/python
# -*- coding: utf-8 -*-
# Write sentence as string
sentence = "Je vois La Vie en rose... Tu vois Le Ciel en vert!"
# Print sentence
print("phrase originale:", 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("phrase sans espaces:", "".join(new_letter))