print("Hello! I'm a simple chatbot.
Type 'bye' to end the chat ")
while True:
user_input = input("You: ").lower()
if user_input == "hlo":
print("Bot: Hi, what's up!")
elif user_input == "nice what about you?":
print("Bot: Good!")
elif user_input == "what's your name?":
print("Bot: I'm a Python chatbot. Your name please?")
elif user_input == "yashika gupta. can i ask a small help from u please?":
print("Bot: Yes for sure. What help do you need?")
elif user_input == "i need small help in maths holiday homework":
print("Bot: Sure! Please tell me what help you need in maths.")
elif user_input == "i am having some problems in solving questions of
adding. will u be able to help me?":
print("Bot: Yes for sure! Please write 2 numbers you want me to add.")
try:
num1 = float(input("Bot: Enter the first number: "))
num2 = float(input("Bot: Enter the second number: "))
total = num1 + num2
print("Bot: Here is your answer:", total)
except ValueError:
print("Bot: Please enter valid numbers.")
elif user_input == "thankx for helping me":
print("Bot: You're welcome! But I need to go, my battery is low.")
elif user_input == "bye":
print("Bot: Bye! Take care.")
break
else:
print("Bot: I'm not able to understand. Can you try saying that a different
way?")