Created
December 2, 2009 16:04
-
-
Save jkern/247311 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random # Let's just keep this line. And move on -- jkern | |
counter = 0 # So we want to count how many times we do something. -- jk | |
num0 = 0 | |
while counter < 100: # Here let's do something until counter is 99. -- jk | |
number = random.randrange(0,9) # Now we're creating a random number. --jk | |
if number == 0: # You'll need to check for all the numbers. -- jk | |
num0 += 1 | |
counter += 1 | |
else: | |
counter += 1 | |
continue | |
print num0 | |
# random choice from 0 to 9 | |
#for i in range(10): | |
# print random.choice([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) | |
# print "#" * i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment