commited all contents created by participants
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/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()+'.')
|
||||
Reference in New Issue
Block a user