Discussion about this post

User's avatar
Yuvraj Raghav's avatar

Hiii there its my solution :

print("Hi! I'm ChatBot. Type 'Bye' to exit.")

while True:

chatbot = "ChatBot:"

user_input = input("You: ")

match user_input.lower().strip():

case 'hello':

print(f"{chatbot} Hello there!")

case 'how are you':

print(f"{chatbot} I'm just a code, but thanks for asking")

case 'bye':

print(f"{chatbot} Goodbye!")

break

case _:

print(f"{chatbot} Sorry, I don't understand that.")

Expand full comment

No posts