我對與編程有關的所有事情都很陌生,剛剛完成了python課程的介紹並嘗試啓動一些項目。 我遇到了一些我找不到的東西。我的初學者項目出錯
lives=3
while lives>0:
low=raw_input("what is the lower range that you will guess? Numbers only please.")
high=raw_input("what is the higher range that you will guess? Numbers only please")
thenumber=randint(int(low),int(high))
if int(raw_input("pick an integer between %s and %s") %(low, high))==thenumber:
print "you won!"
設置兩個變量爲「1」,它打印「挑%s和%s之間的整數」而不是「挑1和1之間的整數」之後。
編輯:提交的編號爲的猜測後,我也得到
TypeError: not all arguments converted during string formatting
一般情況下,嘗試谷歌搜索您收到的任何錯誤:https://www.google.it/search?client=safari&rls=zh-CN&q=TypeError:+not+all+arguments+converted+during+string+formatting&ie=UTF-8&oe=UTF-8&gfe_rd=cr& dcr = 0&ei = APa9Wc6ADq_CXuzysZgC –