Question
Take the program you designed for Flow Control Lab Part 1 and modify it to allow the program to keep running until a condition is
Take the program you designed for Flow Control Lab Part 1 and modify it to allow the program to keep running until a condition is met, and add a for loop that executes a random number of times.
The program must:
build off of your program designed in Lab 2 Part 1, making changes as you need to
include one while loop that ends the program based on user's input, otherwise the program will keep asking the questions over and over again
include one for loop that will iterate a random number of times, displaying something to the user that same number of times
Note: Input validation is not required, so assume the user will enter answers that make sense for the questions you ask. However, make sure your program does something when receiving unexpected input.
Part 1 my current work :
# user will enter name name= input("Enter your name:") #user will enter favorite cusine and plate cusine = input(f"Hey! {name}, What culture cusine do you enjoy?: ").lower() plate = input(f"Which {cusine} food is your favorite? ").lower() # if user chooses american if cusine == "american": if plate == "hamburgers": print("Hamburgers, are delicious I enjoy mine with a side of fries.") elif plate == "fried chicken" print("Yumm, fried chicken is the best with a side of mashed potatos and gravy.") else: print("American food is great, I can see why you enjoy what you do.") # if user chooses italian elif cusine == "italian": if plate == "pasta": print("Pasta are delicious, I enjoy mine with a glass of wine.") elif plate == "pizza": print("Margherita pizza is my favorite neapoliatan pizza.") else: print(f"I think all italian food is great but pizza is my favorite dish.") # if user chooses other then american or italian else: print("There are many different culture cusine, but my top favorite are Italian and American.")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started