Merge branch 'master' of githubu:GeoffreyFrogeye/tp-info
Merge
This commit is contained in:
commit
1065cdb804
|
@ -124,6 +124,7 @@ print('De par cet exemple, on remarque que chaine reste la même chaîne de cara
|
||||||
question(4)
|
question(4)
|
||||||
|
|
||||||
def join(chaine, sequence):
|
def join(chaine, sequence):
|
||||||
|
# TODO Docstring
|
||||||
res = ''
|
res = ''
|
||||||
l = len(sequence)
|
l = len(sequence)
|
||||||
for i in range(l):
|
for i in range(l):
|
||||||
|
@ -174,6 +175,15 @@ section('Une fonction sort pour les chaînes')
|
||||||
|
|
||||||
question(1)
|
question(1)
|
||||||
|
|
||||||
|
def sort(chaine):
|
||||||
|
# TODO Docstring
|
||||||
|
# TODO On peut pas faire plus court ?
|
||||||
|
l = list(chaine)
|
||||||
|
l.sort()
|
||||||
|
return ''.join(l)
|
||||||
|
|
||||||
|
print('>>> sort(\'timoleon\')')
|
||||||
|
print(sort('timoleon'))
|
||||||
|
|
||||||
|
|
||||||
partie('Anagrammes') # Jean-loup
|
partie('Anagrammes') # Jean-loup
|
||||||
|
|
Reference in a new issue