school.bao
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
# school.bao — gestion des étudiants
classe Etudiant:
fonction nouveau(nom, notes):
ce.nom = nom
ce.notes = notes
fonction moyenne():
total = 0
pour n dans ce.notes:
total = total + n
retourner total / longueur(ce.notes)
etudiants = [
nouveau Etudiant("Amina", [16, 14, 16.5]),
nouveau Etudiant("Kofi", [10, 13, 13]),
nouveau Etudiant("Fatou", [18, 17, 16.5]),
]
afficher("🎓 École Baobab")
meilleur = etudiants[0]
pour e dans etudiants:
afficher(e.nom + " — moyenne: " + texte(e.moyenne()))
si e.moyenne() > meilleur.moyenne():
meilleur = e
afficher("Meilleur: " + meilleur.nom)
Baobab Studio Terminal v1.0.0 — type 'help' for commands