Write a Python program:
The function is named validity(). It receives 2 floating pointparameters, min and max, from the program that invoked it. Thefunction asks the user to enter a float number. Using a while loopit checks whether the number is valid (between min and max,inclusive). If not valid, the while loop uses this statement toprompt for a new number: num = float (input (\" Enter a number thatis at least :\"+ str(min) + \"and at most: \"+ str(max) + \" : \")).Once the function decides a number is valid, it returns it to theprogram. The program inputs 2 floating point numbers, max and min.It then invokes the validity() function with this statement:“validNum = validity(max,min)â€. Once a valid number is returned tothe program by the function. The program will print out the valuesof max, min, and the valid number returned.