Question: help with this please a) Write a short script that performs these tasks: 1) Prompts the user for two integer numbers and stores them in
a) Write a short script that performs these tasks: 1) Prompts the user for two integer numbers and stores them in separate variables named M and N. 2) Creates a Python list variable named P containing all of the integers from M to N (in that order, including both endpoints). The code should work regardless if M is less than N or if M is greater than N. If M is equal to N, the list should contain just a single value. 3) Prints out the final P list. Examples: M is 2,N is 4P is [2,3,4]M is 2,N is 2P is [2,1,0,1,2]M is 1,N is 1P is [1] Sample Run: Enter M: 3 Enter N: 6 P is [3,4,5,6] b) You are deciding whether to go out to a new bar and have a drink with one of your friends or to stay home instead. Here are some conditions that apply to both persons: The drinks are alcoholic, so the minimum age to get into the bar is 21 and over. Also, the bar is very far away, so at least one person must have a car. This particular bar is only open for business on Friday and Saturday. Finally, if either person is feeling too tired. then no one wants to go out. Here are seven predefined variables that you can use: you_age, friend_age (integer: Current age of the person) you_car. friend_car_ (boolean: True if person has a working car, False otherwise) you_tired. friend_tired (boolean: True if person is too tired to go out, False otherwise) day_of_week (string: Can be "Mon". "Tue", "Wed". "Thu", "Fri", "Sat", or "Sun") Write a Python conditional expression that evaluates to True if all of the conditions needed to go out are satisfied, or to False if any condition is violated. Use the variable names given above (assume they contain values already) and any of the Python comparison operators and logical operators you wish. Note: Just write the expression to be tested. You do not need to write a branching statement to put it in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
