Computer Science, asked by anshikatiwari6951, 10 months ago

Edhesive assignment 3 chatbot

Answers

Answered by yashtomar505
4

Answer:

a chat bot is computer program designed to emulate human conversation for this program you will use if statement, user input and random number to create a basic chatbot

Answered by sunnyshinesundae
0

Answer: import random

name=input("What is your first name? ")

shoes=input("What shoes do you like? ")

print("Nice, casual is always in!")

print("How old are you?")

age = int(input(" "))

print(str(age) + " is a good age to start exploring style")

if(age >= 16):

 print("and, you are old enough to drive. \n")

else:

 print("Still taking the bus, I see. \n")

print("So, " + name + ", how are you feeling today?")

feel=input(" ")

if(feel== "happy"):

 print("That is good to hear.")

elif(feel == "sad"):

 print("I'm sorry to hear that. ")

else:

 print("Oh my!")

print("Tell me more.")

elaborate=input(" ")

print("Well that's interesting. I hope life treats you well! \n Do you have plans for later?")

ans=input(" ")

if(ans== "yes"):

   print("Awesome! I hope you have fun!")

   

elif(ans== "no"):

   print("Aw, maybe we can make some plans then?")

   

else:

   print("Alright! You can tell me more later.")

   

flav=input("What's your favorite icecream flavor? ")

if(flav== "vanilla"):

   print("Yum! Simple, yet delicious.")

   

elif(flav== "chocolate"):

   print("Ah, I don't like chocolate.. It's my least favorite.")

   

else:

   x=random.randint(1,3)

   if x==1:

       print("Sounds delicious! I'll have to give it a try!")

   elif x==2:

       print("I've never heard of that before! I'll give it a try!")

   else:

       print("I've tried that! It's really good.")

Explanation: I love y'all for free

Similar questions