Problème avec une valeur suite à l'utilisation de while
arthurlfbv
-
Phil_1857 Messages postés 1956 Statut Membre -
Phil_1857 Messages postés 1956 Statut Membre -
Bonjour,
J'ai un problème, lorsque le print est dans la boucle while la valeur n'est pas la même qu'en dehors de la boucle alors que je n'ai rien modifié
nom_pl1='messi'
nom_pl2='ronaldo'
point_pl1= 0
point_pl2= 0
jeu_pl1= 0
jeu_pl2= 0
set_pl1= 0
set_pl2= 0
while point_pl1 !=4 or point_pl2 !=4:
from random import randint
a = randint(0,1)
if a == 0:
point_pl1 += 0
point_pl2 += 1
else:
point_pl1 +=1
point_pl2 +=0
if point_pl1 >4:
break
elif point_pl2 >4:
break
print(f"{point_pl1} {nom_pl1}")
print(f"{point_pl2} {nom_pl2}")
from random import randint
b = randint(0,1)
if b == 0:
point_pl1 += 0
point_pl2 += 1
else:
point_pl1 +=1
point_pl2 +=0
if point_pl1 >4:
break
elif point_pl2 >4:
break
print(f"{point_pl1} {nom_pl1}")
print(f"{point_pl2} {nom_pl2}")
from random import randint
c = randint(0,1)
if c == 0:
point_pl1 += 0
point_pl2 += 1
else:
point_pl1 +=1
point_pl2 +=0
if point_pl1 >4:
break
elif point_pl2 >4:
break
print(f"{point_pl1} {nom_pl1}")
print(f"{point_pl2} {nom_pl2}")
from random import randint
d = randint(0,1)
if d == 0:
point_pl1 += 0
point_pl2 += 1
else:
point_pl1 +=1
point_pl2 +=0
if point_pl1 >4:
break
elif point_pl2 >4:
break
if point_pl1 ==4 and point_pl2 !=0:
break
elif point_pl2 ==4 and point_pl1 !=0:
break
if point_pl1 >4:
break
elif point_pl2 >4:
break
print(f"{point_pl1} {nom_pl1}")
print(f"{point_pl2} {nom_pl2}")
print(f"{point_pl1}")
print(f"{point_pl2}")
Windows / Chrome 107.0.0.0
A voir également:
- Problème avec une valeur suite à l'utilisation de while
- Utilisation chromecast - Guide
- Télécharger gratuitement notice d'utilisation - Guide
- La ressource demandée est en cours d'utilisation ✓ - Forum Caméra
- Logiciel gratuit calcul valeur nutritionnelle - Télécharger - Santé & Bien-être
- Formule excel si contient texte alors valeur ✓ - Forum Excel