80.9k views
2 votes
Assignment 3: Chatbot
What the code for assignment 3: chatbot Edhesive.

Assignment 3: Chatbot What the code for assignment 3: chatbot Edhesive.-example-1
User DougC
by
4.8k points

1 Answer

5 votes

Answer:

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

name2=input("What is your last name? ")

print("Hi there, "+ name1+" "+name2 +" ,nice to meet you!")

print("How old are you?")

age = int(input(" "))

print(str(age) + " is a good age.")

if(age >= 16):

print("You are old enough to drive. \\")

else:

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

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

feel=input("")

print("You are " + feel),

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. \\")

next=input("")

import random

r = random.randint(1, 3)

if(r==1):

print("Sounds interesting. \\")

elif(r==2):

print("That's good to hear. \\")

else:

print("How unusual. \\")

print("Well, " + name1 + ", it has been nice chatting with you.")

Step-by-step explanation:

This worked for me.