Created
December 2, 2009 06:44
-
-
Save jkern/247000 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
#!/usr/bin/python | |
""" This Program prints a horizontal histogram of 100 random digits | |
By: Larry Harvey | |
WIS 290 | |
MidTerm Exam | |
problem # 1 | |
Fall Block 2 2009""" | |
import random | |
print "Welcome to Random Numbers!" | |
print "\nLets Get Random!!!!!!!" # Hell yeah! -- jkern | |
print "\n100 Random Numbers: " | |
count = 0 # Sweet, nice iterator. -- jkern | |
while count < 100: | |
number = random.randrange(0,9) | |
if number == 0: | |
num0 +=1 | |
#digit = random.randrange(101) # you lost me from here ... --jkern | |
#for number in range(10): | |
# while number == digit: | |
# print number # ... until here. -- jkern | |
count += 1 # iteration rules -- jkern | |
else: | |
count += 1 # I told you iteration rules! -- jkern | |
continue | |
print "0 ", "*" * num0 | |
# Now you need to figure out how the rest of it's supposed to work |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment