0
我有一個用Python編寫的小程序。除了基於命令行之外,它應該像Siri一樣和你說話。它問你你的一天是如何,當你把好它應該挑1,滿分5個良好的反應,說給你,但我一直在這裏得到一個遞歸的錯誤是我的代碼Python遞歸錯誤調用Python對象時超出最大遞歸深度
def nice5():
print ("Well Thats Good!")
time.sleep(2)
randsub(2)
def nice4():
print ("Great!")
time.sleep(2)
randsub()
def nice3():
print ("Thats Good!")
time.sleep(2)
randsub()
def nice2():
print ("Cool I am glad to hear that!")
time.sleep(2)
randsub()
def nice1():
print ("Thats Good! ")
time.sleep(2)
randsub()
def nicerand():
randnices = [nice1 , nice2 , nice3 , nice4 , nice5]
randnice = random.choice(randnices)
nicerand()
def p1checkChoice():
if choice == "Good":
nicerand()
if choice == "good":
nicerand()
if choice == "GOOD":
nicerand()
def greeting():
clearscr()
name = input("Hello What is your name: ")
clearscr()
print ("Hello " + name)
time.sleep(2)
clearscr()
print ("Allow me to introduce myself")
time.sleep(2)
clearscr()
print ("My name is Chatbot")
time.sleep(2)
clearscr()
choice = input("How has your day been: ")
global choice
p1checkChoice()
greeting()
您能否提供確切的錯誤信息和'Randnices'的定義 –
RecursionError:在調用Python對象時超出最大遞歸深度 –
'全局選擇'大寫'G'?請提供您使用的確切來源。 – Jasper