Я создаю чат-бота, но после множества изменений я попытался его протестировать, но единственное, что произошло, это то, что он разбился, и я не вижу проблем в коде? может кто-нибудь помочь?
редактировать: теперь есть ошибка в строке 8 (начало в массиве шуток)
вот мой код:
import time
import random
chatbotline = 'Chatbot : '
questions = ['How do you do ?','Whats your name ?','How old are you ?','What do you like to do ?','Whats your favorite movie ?'
,'Whats your favorite book ?','Do you like chatting with me ?','Whats your favorite snack ?','Whats your favorite video game ?']
jokes = ['I ate a clock yesterday, it was very time-consuming.','A perfectionist walked into a bar...apparently, the bar wasn’t set high enough.',
'Did you hear about the crook who stole a calendar? He got twelve months.','Ive just written a song about tortillas. actually, it’s more of a rap.'
]
def main():
print('What whould you like to do ?')
time.sleep(0.2)
options = input('1.Questions\n2.Jokes\n3.Opinion\n4.Exit\n')
if(options == 1) :
questionpick()
def questionget():
questiongot = random.choice(questions)
main()
def questionask():
def questionpick():
time.sleep(0.2)
print('Do you want to ask questions ?')
questoptions = input('1.Yes\n2.No, you \n')
if(questoptions = 1) :
questionask()
elif(questoptions = 2) :
questionget()
print('starting up...')
time.sleep(0.5)
print('Chatbot : Hello im chatbot your new friend !')
time.sleep(0.2)
print('Chatbot : So what do you want to do today ?')
time.sleep(0.2)
options = input('1.Questions\n2.Jokes\n3.Opinion\n4.Exit\n')
if(options == 1) :
questionpick()