
April 9th, 2004, 01:44 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
Use a second variable and increment it each time you reset the number to 0.
Code:
counter = number = 0
for loop in range(0, 500):
number += 1
# Check if number has reached 30
# and if so, reset it and increment counter
if number == 30:
number = 0
counter += 1
print "We cycled ", counter, "times"
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
|