I am 9 year old kid trying to automate the random numbers maths toward my abacus.
I want to generate values randomly and store them in memory for later ,when i press to check for addition. then it should give the addition value of all the random numbers.
so far I have this code
# my abacus training app
import random
import time
print ('hey what\'s your name')
name = input()
print("well today i am goingto ask abacus questions ")
print ("choose a level")
levelOne = print ("level 1")
print (levelOne)
choice = input()
if choice.endswith("1") :
print("let's start")
noone = random.randint(1,10)
print (noone)
time.sleep(5)
notwo = random.randint(1,10)
print (notwo)
time.sleep(5)
nothree = random.randint(1,10)
print (nothree)
time.sleep(5)
nofour = random.randint(1,10)
print (nofour)
time.sleep(5)
nofive = random.randint(1,10)
print (nofive)
time.sleep(5)
=======I am posting Final Answer for above question, this was my final code, Thanks to Srig and Hamed Temsah for the inputs=== thanks to everyone who supported me.
# my abacus training app
import random
import time
print ('hey what\'s your name')
name = input()
print("well today i am goingto ask abacus questions ")
print ("choose a level")
choice = input("choose a level : ")
if choice.endswith("1") :
print("let's start")
noone = random.randint(1,10)
print (noone)
time.sleep(10)
notwo = random.randint(1,10)
print (notwo)
time.sleep(10)
nothree = random.randint(1,10)
print (nothree)
time.sleep(10)
nofour = random.randint(1,10)
print (nofour)
time.sleep(10)
nofive = random.randint(1,10)
print (nofive)
time.sleep(10)
print ("click enter to check your ans")
input ()
print(noone+notwo+nothree+nofour+nofive)
Great job 9 year old kid, you did a great job! If I understood your question clearly, you want to ask the user to input another character after generation of these 5 random numbers. If it had the character '+' , then you should print summation of all these random numbers, you can re-use your own code to achieve this like:
operand = input()
if operand.endswith("+") :
print(noone+notwo+nothree+nofour+nofive)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments