from random import random def attente_succes(p): temps_attente=1 alea=random() while alea>p: alea=random() temps_attente+=1 return temps_attente