1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| while True:
x=[".,",",.",",,"," ","."," ,",","]
C=input("entrez à nouveau une phrase:")
phrase=C
if phrase[-1]!=".":
C="".join((C,"."))
print(C)
if x[0] in C:
C=C.replace(".,",",")
print(C)
if x[1] in C:
C=C.replace(",.",",")
print(C)
if x[2] in C:
C=C.replace(",,",",")
print(C)
if x[4] in C:
C=C.replace(".",". ")
print(C)
if x[5] in C:
C=C.replace(" ,", ", ")
print(C)
if x[6] in C:
C=C.replace(",",", ")
print(C)
if x[3] in C:
C=C.replace(" "," ")
print(C)
C=C.split(". ")
C=C[0].upper()+C[1::]
print(str(C))
print(len(C.split(" ")), "mot,",len(list(C.split(','))), "conteneurs séparés par des virgules et", len(C.split('.'))-1, "phrase") |
Partager