Question: PYTHON 1- Use the random number generator from the last slide (Flow of control ppt) to generate a random number between 0 and 1, then
PYTHON
1- Use the random number generator from the last slide (Flow of control ppt) to generate a random number between 0 and 1, then using this number, make some calculations to then generate the simulation of rolling a six sided dice (return a value ranging from 1 to 6)Use the random number generator from the last slide (Flow of control ppt) to generate a random number between 0 and 1, then using this number, make some calculations to then generate the simulation of rolling a six sided dice (return a value ranging from 1 to 6)


You try: Exercise 2 At LaRonde amusement park, there is some restrictions regarding the height of individuals to partake on certain rides Create a program that asks the user for their height and receives the input using the input() function. The minimum height for the ride is 120cm and someone lower than 130cm must be with an adult to go on the ride. Make the program using branching statement and input function and display the appropriate print statements to the user. Create a separate program that use if elif else statements and not nested if statements. You try: Exercise 3 An online music and apps store offers all apps for 3$ each and all songs for 7$ each. The store requires members to prepay any amount of money they wish, and then download as many apps or as many songs accordingly. You are required to write a program that would ask the user for the amount that he/she will pay, then display two messages indicating: - the maximum number of apps that can be downloaded, and how much funds will remain in the account after that, if any. - the maximum number of songs that can be downloaded, the number of apps that can be downloaded after that if funds allow, and how much funds will remain in the account after that, if any. For this exercise, assume that the user will always enter a valid integer value that is >= 0, and within the limit of the integer range. An example of how your program should behave is indicated on the next two slides Exercise 3:Sample Output Sample 1: How much money do you wish to prepay? 89 With this amount, you will be able to purchase 29 app(s). You will then have 2$ left as a credit on your account. Alternatively, for this amount, you will be able to purchase 12 song(s) and 1 app(s). You will then have 2$ left as a credit on your account. Thanks for Shopping at the Best Music Store
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
