Question: 7 . 1 7 . 2 : Arrange the code to return an integer value read from the user that is within a given range.
: Arrange the code to return an integer value read from the user that is within a given
range.
Arrange the following lines of code for the body of the function readFromUser that continues to read data from the user until an
integer in the given range is read. Use all lines in your solution.
Empty print statements are included for output formatting. Your code will be tested using readFromUser
How to use this tool
Unusedexcept ValueError :
if value low or value high :
try :
printError: invalid data type."
printError: value is out of range."
done True
while not done :
else :
return value
value intinputEnter an integer value:
printreadfromuserpy
Load default template...
# Returns an integer value read from the user
# that is within a given range.
# @param low the low end of the valid range
# @param high the high end of the valid range
# @return the valid integer read from the user
#
def readFromUserlow high :
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
