Question: ' ' ' Program that has a conversation with the user. Uses elif branching and a random number to mix up the program's responses. '
Program that has a conversation with the user.
Uses elif branching and a random number to mix up the program's responses.
import random # Import a library to generate random numbers
printTell me something about yourself.
printYou can type Goodbye at anytime to quit.
usertext input
while usertext 'Goodbye':
randomnum random.randint # Gives a random integer between and
if randomnum :
print
Please explain further.
elif randomnum :
printf
Why do you say: usertext
elif randomnum :
print
What else can you share?
else:
print
Uhoh something went wrong. Try again.
usertext input
printIt was nice talking with you. Goodbye.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
