Answered step by step
Verified Expert Solution
Question
1 Approved Answer
pyhton programming 1. Create a validation module name the file validation.py The module should have a main() function to test the functions in it. The
pyhton programming
1. Create a validation module name the file validation.py The module should have a main() function to test the functions in it. The validation module should include the following functions: a. A get pos int() function that accepts user inputs for an integer greater than zero. The user should be prompted to enter a value until the value entered meets the above mentioned requirements integer and greater than zero) b. A get_float() function that accepts the user input for a float value between a low and a high range. The user should be prompted to enter a value until the value entered meets the above-mentioned requirements (float, greater than the low and lower than the high) c. A get_title() function that accepts user input for a string representing the user title which should be one of the following values: Mrs., Mr., Ms., Dr., Prof. d. A tuple_list_stats() function that has a tuple of integers or a list of integers as a parameter and returns the average, minimum, maximum of the values in the tuple of list as well as the number of duplicates. The function should also print the elements in an ascending or descending order. e. A function that takes a list of strings as a parameter and prints out the elements sorted in ascending and descending order. Make sure to take in consideration the letter case of the list elements. Give a meaningful name to your function that follows Python naming convention for functions. f. A function that calculates the sum of numbers from 1 to x where x is specified when the function is called in main function. You must complete this function recursively. g. A function that takes a list of integers as a parameter and returns the element with the maximum value. You must complete this function recursively. h. A function that returns how many digits a positive integer has. You must complete this function recursively. Remember that we can calculate the number of digits by repeatedly dividing the integer to 10 without keeping the remainder until the number is less than 10 (therefore consisting of one digit only). Add I to this value for each time we divide by 10. When testing this function in main use the following test values: 13, 103, 13903. 2. Import the validation.py module into a new module and test each function. Page 2 of 2 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started