Question: Write a Python program that generates 2 random numbers between 2 and 3 5 inclusive. A sum will be generated by adding the generated numbers.

Write a Python program that generates 2 random numbers between 2 and 35 inclusive. A sum will be generated by adding the generated numbers. Then , the program will find the number of times it takes for the sum is be reproduced again Your program will calculate and display the number of times the numbers are generated in order to get the desired sum. Note that the smallest generated number is 2 and the largest generated number is 35. So, the smallest sum of the numbers is 4 and the largest sum of the numbers is 70. Use the random number generator to randomly generate a number between 2 and 35 inclusive . Note: Mut used 2 functions. The first function is used to generate the two random numbers. The function then will sum the randomly generated numbers and return the sum back to the main script. The second function is used to calculate and return the number of times the numbers are generated to get the desired sum. The function will accept the sum of the two generated numbers from the main script. Number of Times the Numbers were Generated is displayed from the main script.

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 Programming Questions!