Created
January 24, 2014 16:35
-
-
Save gabegaster/8600905 to your computer and use it in GitHub Desktop.
Train Yourself to Take Cube Roots
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
''' | |
A script to train myself on knowing the cuberoots of perfect cubes with 6 digits or less. | |
''' | |
import sys, random, time | |
print "welcome to know these ten cubes " | |
count = 0 | |
start = time.time() | |
for i in range(10): | |
correct = True | |
x = random.randint(0,100) | |
while True: | |
sys.stdout.write(str(x**3)+"\n") | |
choice = int(raw_input()) | |
if choice != x: | |
print "nope" | |
correct = False | |
else: | |
print "good job" | |
count += int(correct) | |
break | |
print "you got %s correct in %s seconds"%(count, | |
time.time()-start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment