Skip to content

Instantly share code, notes, and snippets.

@GravenilvecTV
Created December 19, 2018 13:21
Show Gist options
  • Save GravenilvecTV/c03da92e3ed3f475888aa249818745b4 to your computer and use it in GitHub Desktop.
Save GravenilvecTV/c03da92e3ed3f475888aa249818745b4 to your computer and use it in GitHub Desktop.
BTS SIO
fichclient = [
[
"ANAP",
"ABRI",
"PROLAN"
],
[
"11/04/2003",
"10/04/2003",
"11/02/2006"
]
]
def class_chrono(nom):
chrono = []
n = len(nom)
print("Chaine d'entrée", nom)
for i in range(0, n):
a = nom[1][i]
chrono.append(int(a[6:10]) * 10000 + int(a[3:5]) * 100 + int(a[0:2]))
for i in range(0, n - 1):
for j in range(i, n):
if chrono[i] > chrono[j]:
nom[0][i] = nom[0][j]
nom[0][j] = nom[0][i]
nom[1][i] = nom[1][j]
nom[1][j] = nom[1][i]
print("Chaine de sortie", nom)
return nom
def aff(nom):
n = len(nom)
listaff = []
for i in range(0, n - 1):
listaff[i] = nom[0][i], "client depuis le", nom[1][i]
print(listaff)
listaff = class_chrono(fichclient)
# affichage
# aff(listaff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment