Bonjour,

J'aimerais créer un classement des meilleurs buteurs il y a 3 joueurs qui participent à ce classement. En tout il y aura deux tours:
On attribue les points en fonction des buts.

Au premier tour vous marquez le plus de buts vous avez 6 points, vous marquez le moins de buts vous avez 2 points , vous êtes entre les deux vous avez 4 points.

Maintenant j'aimerais créer une fonction qui regroupe le nom des joueurs de foot et j'aimerais additionner leurs points.
Voici le résultat que je souhaiterai obtenir.

Premier tour:
Drogba 2 points 6 buts
Owen 4 points 12 buts
Henry 6 points 18 buts

Deuxième tour:
Henry 2 points 6 buts
Drogba 4 points 5 buts
Owen 6 points 8 buts

Classement Final :
Drogba 6 points
Henry 8 points
Owen 10 points

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
 
def printOne(name, goal1):
    score1 = []
    for i in range( len( name) ):
 
        print("\t\t\t\t" + name[ i ] + "\t " + str(point[i]) + " point - \t" + str( goal1[i]) + " buts")
 
        score1.append(point[i])
 
 
 
def trisGoal1(name ,goal1):
 
    for i  in range( len(name)-1, 0, -1 ):
 
        for j in range(i):
 
            if name[j+1] < name[ j ]:
 
                FlagParti = name[ j ]
 
                FlagLong = goal1[ j ]
 
                name[ j ] = name[ j + 1 ]
 
                goal1[ j ] = goal1[ j +1 ]
 
                name[ j + 1] = FlagParti
 
                goal1[ j + 1 ] = FlagLong
 
def printSeconde(name, goal2):
    score2 = []
    for i in range( len( name) ):
 
        print("\t\t\t\t" + name[ i ] + "\t " + str(point[i]) + " point - \t" + str( goal2[i]) + " buts")
 
        score2.append(point[i])
 
 
 
 
def trisGoal2(name , goal2):
 
    for i  in range( len(name)-1, 0, -1 ):
 
        for j in range(i):
 
            if name[j+1] < name[ j ]:
 
                FlagParti = name[ j ]
 
                FlagLong = goal2[ j ]
 
                name[ j ] = name[ j + 1 ]
 
                goal2[ j ] = goal2[ j +1 ]
 
                name[ j + 1] = FlagParti
 
                goal2[ j + 1 ] = FlagLong
 
def printFinal(name):
 
    for i in range( len( name) ):
      print("\t\t\t\t" + name[ i ] )  
 
 
name = ["Henry", "Owen", "Drogba"];
point = [2,4,6]
goal1 = [18,12,6]
goal2 = [6,8,5]
 
print("Premier tour ") 
trisGoal1(goal1, name)
printOne(name, goal1)
 
print("Second tour ") 
trisGoal2(goal2, name)
printSeconde(name, goal2)
 
print("Affichage Final ")  
printFinal(name)