Question: Need This in Python a. Write a function named isNumber to validate whether A STRING INPUT by a user contains a number. The function should
Need This in Python a. Write a function named isNumber to validate whether A STRING INPUT by a user contains a number. The function should have ONE STRING AS AN INPUT PARAMETER. The function should determine if THE STRING CONTAINS a number. At a minimum, this function should: i. Check for a negative sign in first position ii. Check to see if more than one decimal iii. Check to see if each character in the string is a valid character The function should return a Boolean value = True if the string contains a number. The function should return a Boolean value = False if the string does not contain a number. b. Write a function named isWithinRange to validate whether a number input by the user falls within a specific range. The function should accept three input parameters: A NUMBER TO VALIDATE A NUMBER REPRESENTING THE LOWER BOUND OF THE RANGE A NUMBER REPRESENTING THE UPPER BOUND OF THE RANGE The function should perform two tests: i. Check to see if the lower bound is less than the upper bound ii. Check to see if the number is between the lower and upper bound The function should return a Boolean value = False if the lower bound is greater than the upper bound. The function should return a Boolean value = True if the number falls within the lower and upper bounds. The function should return a Boolean value = False if the number is not within the lower and upper bounds.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
