Assignment 3: Chatbot
Pls answer
Answers
Answer:
I hope you want to create a chatbot on notepad
Steps-
1. Open Notepad. To open notepad use the shortcut key to open run that is WINDOWS+R and type "Notepad" then press the "ok" button.
2. Then type the script-
You can type anything inside (" ").
fname= inputbox ("Hello There!")
fname= inputbox ("What is your name")
fname= inputbox ("I am Chatbot")
fname= inputbox ("How is life")
fname= inputbox ("Good")
fname= inputbox ("Do you like to play guitar")
fname= inputbox ("Good")
fname= inputbox ("Now i have to go")
fname= inputbox ("Bye! Hope you enjoyed")
3. After you have typed your script, Press CTRL+SHIFT+S then Change the name of file t Chatbot and change file extension to .vbs from default it would be in .txt
click on "save as type" box by default it would be written " Text Document (*.txt)" Once you click on it there would be written "All Files" Click that and Check the encoding box it might be on "UTF-8" if it is on that change it to "ANSI" by just simply clicking on the encoding box.
That's it choose a place to save your file on desktop i would prefer but its on you.
There will be a file named "Chatbot" its icon will be a like a page with lines and swirled see below it somewhat looks like this. Open it by double clicking it.
Hope it helped, Please mark it as brainliest.
Have a good day ahead
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: