加法運算,我9歲的孩子試圖向我的算盤隨機數的數學自動化。我要生成隨機數,然後做對他們
我想隨機生成值,並將其存儲在內存中供以後,當我按下檢查加法。那麼它應該給出所有隨機數的附加值。
到目前爲止,我有這樣的代碼
# 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)
=======我張貼以上問題的最終答案,這是我最後的代碼,感謝SRIG和哈米德Temsah用於輸入==感謝所有支持我的人。
# 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)
什麼是您收到的錯誤或問題,您所面對? – Ajax1234
你想用這條線做什麼? 'levelOne = print(「level 1」)' – RottenCandy
和PyGame在你的問題在哪裏?你爲什麼設置標籤'pygame'? – furas