Answer to Question #100577 in Python for Jacob

Question #100577
The Scenario
You have decided to start a website and are creating a chatbot prototype to show investors so you can raise money and launch your website.

Your chatbot should ask the user the following (minimum requirements for the autograder) and then give answers depending on the answers the user inputs:

at least 5 questions, and
at least 2 if-elif-else statements.
Based on this criteria, some responses will be based on what the user types, and some will be based on random numbers.

For example, if the chatbot asks how the user is doing, your chatbot might respond I’m sorry to hear that. in response to a user input of sad, or That's great! in response to a user input of happy.

Additionally, you could also have a random number generated between, say, 1 and 3 and have a corresponding response depending on the number to randomly answer with That is great to hear. or So interesting., and so on.
1
Expert's answer
2019-12-18T03:57:58-0500
import random

print('What is you name?')
name = input()
print(f'Hello {name}')
print('What year were you born in?')
age = 2019 - int(input())
if age > 18:
    print('Wow! You so clever')
elif (age < 18):
    print('Wow! You so young')
else:
    print('Ok')
print('What is you  surname?')
surname = input()
i = int(random.uniform(1, 3))
if i == 1:
    print('Today will be hot')
elif i == 2:
    print('Today will be cold')
else:
    print('Today will be great')
print('Where are you from?')
city = input()
print(f'{city} is beautiful!')
print('Do you happy?')
ans = input()
if (ans == 'Yes') or (ans == 'yes'):
    print('Great')
else:
    print('All will be good!')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS