Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.
 
 
 
 
 
 

21 rinda
524 B

  1. # Exercice: rendre la fonction peut_voter() plus lisible
  2. # et plus explicite
  3. class Personne:
  4. def __init__(self, age, nationalité, inscrite):
  5. self.age = age
  6. self.nationalité = nationalité
  7. self.inscrite = inscrite
  8. def peut_voter(personne):
  9. return (
  10. personne.age >= 18 and personne.nationalité == "Française" and personne.inscrite
  11. )
  12. martine = Personne(42, "Française", True)
  13. assert peut_voter(martine)
  14. kevin = Personne(12, "Française", True)
  15. assert not peut_voter(kevin)