Question: PYTHON: Does my current work make sense/satisfy the assignment requirements? Please help me. Take the program you designed for Flow Control Lab Part 1 and

PYTHON: Does my current work make sense/satisfy the assignment requirements? Please help me.

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.

MY CURRENT WORK:

import random name = (input('What is your name? ')) if name: print ('That is an amazing name!') age = int(input('How old are you? ')) if age <= 16: print ('You are young! So much to learn.') elif age <= 18: print ('You will be able to rent hotel rooms and vehicles soon!') else: print ('You are in the prime years of your life! Start studying!') while True: x = int(input('Please enter a number within a range, which will not be specified. ')) if x <0 or x>100: print('Invalid.') else: print('Much appreciated!') break

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!