mardi 12 juillet 2016

whats wrong with this statement(count from 0-9)


I am trying to get this code to calculate 5 and print numbers by 5's with a while statement of 7, so I want it to loop through, generating a different number 7 times; however, when it gets to a number over 10, I want it to start back over at 0 and ignore the 10.

This is my code:

while z < 7:
firstpickplusfive = int(firstpickplusfive) + 1
counts = counts + 1
if counts == 1:
if firstpickplusfive > 9:
firstpickplusfive = 0
if counts == 5:
print firstpickplusfive
z = int(z) + 1

The code prints the first number, but freezes on printing any others. Why isn't this working?


Aucun commentaire:

Enregistrer un commentaire