Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Ask a Question
Ask a Question
input doesen't get through.
So I'm trying to do a chatbot for fun having finished the w3schools py tutorial, the first line asks for input, but the rest of the code isn't executed. What's wrong with my code?
text = input().lower()
found_greeting = text.find("hello") or text.find("hi") or text.find("greetings")
found_hobbies = text.find("enjoy") or text.find("like") or text.find("find fun") or text.find("enjoys") or text.find("likes") or text.find("finds fun")
if found_greeting >= 0:
print('Hello! I\'m PyChat, an artificial intelligence. How may I help you? ')
if found_hobbies >= 0:
print('I also enjoy that, what a coincidence!')
closed with the note:
SOLVED! thank you I
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
To avoid this verification in future, please
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
Snow Theme by