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.

closed input doesen't get through.

+1 vote
asked Mar 1, 2023 by JuSt HoTMaiL CurSeS (330 points)
closed Mar 2, 2023 by Admin
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?

import math
import random
import time

while True:
    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

1 Answer

0 votes
answered Mar 1, 2023 by JuSt HoTMaiL CurSeS (330 points)
 
Best answer

SOLVED! thank you I really am dumb

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.
...