19 lines
468 B
Python
19 lines
468 B
Python
#!/usr/bin/python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#Ask to write a sentence
|
|
sentence = "Les gouvernements suspectent la littérature parce qu'elle est une force qui leur échappe"
|
|
# print sentence
|
|
print("phrase originale:", sentence)
|
|
|
|
# Split sentence into words
|
|
words = sentence.lower().split()
|
|
print(words)
|
|
|
|
# ordre alphabétique
|
|
words.sort()
|
|
print(words)
|
|
|
|
# print sorted wordlist as string
|
|
print("phrase alphabétique:", " ".join(words).capitalize()+'.')
|