Skip to content

Instantly share code, notes, and snippets.

@gabegaster
Created January 24, 2014 16:35
Show Gist options
  • Save gabegaster/8600905 to your computer and use it in GitHub Desktop.
Save gabegaster/8600905 to your computer and use it in GitHub Desktop.
Train Yourself to Take Cube Roots
'''
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