mercredi 25 septembre 2019

Is there a way for a for loop to not go back to the code on top if the next if statement is true?

a = 0 b = 0

for x in range (100):
    a = a + 1
    if a == 10:
        b = b + 1

print(a) print(b)

The outcome 99 1

What I want 10 90

Aucun commentaire:

Enregistrer un commentaire