Question

3.a The function is named validity(). It receives 2 floating point parameters, min and max, from...

3.a The function is named validity(). It receives 2 floating point parameters, min and max, from the program that invoked it. The function asks the user to enter a float number. Using a while loop it checks whether the number is valid (between min and max, inclusive) If not valid, the while loop uses this statement to prompt for a new number: num = float (input (" Enter a number that is at least :"+ str(min) + "and at most: "+ str(max) + " : ")). Once the function decides a number is valid, it returns it to the program. Fill in this function table: Function Name Purpose Required inputs Expected result 3 F19 H W C10

3.b Write the function code

0 0
Add a comment Improve this question Transcribed image text
Answer #1

def validity(minN,maxN):

while(True):

num = float (input (" Enter a number that is at least :"+ str(minN) + "and at most: "+ str(maxN) + " : "))

if num>=minN and num<=maxN:

break

return num

minN=1

maxN=100

validN=validity(minN,maxN)

print("Min : ",minN)

print("Max : ",maxN)

print("Valid number: ",validN)

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
3.a The function is named validity(). It receives 2 floating point parameters, min and max, from...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT