Question: Task 1 ( of 2 ) : Develop a python seript called HW 1 2 p 2 _ Task 1 _ UCusername.py where you generate
Task of :
Develop a python seript called HWpTaskUCusername.py where you generate random numbers between and filter them based on userdefined lower and upper bounds, and display the valid readings.
The program should:
First. prompt the user to input the target number of valid readings. ensuring that it is a positive integer. If it is not a positive integer, the program should inform the user they entered a nonpositive integer and ask them to reenter the value.
Next, the users will be asked to provide the lower and upper bounds for the valid readings, ensuring that both bounds are between and If not, the program should inform users they must bound their values between and and ask them to reenter the values.
The program will then generate random floatingpoint numbers by importing the random library import random and then using the following Python Function: random. uniform
Then, values that fall within the specified bounds should be added to a List of valid numbers using the append funetion.
Once the target number of valid readings is reached. the program should print the list of valid numbers rounded to two decimal places. The program should also print the total number of random numbers generated.
Test Case:
Enter the target number of valid readings; enter the taryet bound for valid reading: Fonter the upper bound for vilidreadings:
valid values List:
:
Total randoin neniters generatets:
A Random Number Generator was used, so your values will not exactly match the test case shown above.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
