Complete the isOdd() function to take an int value and returns True if the parameter's value is odd and False otherwise.
Examples:
isOdd( 5 ) returns True
isOdd( 10 ) returns False
def isOdd(): def main(): argument = 5 returnValue = isOdd( argument ) print( 'isOdd(',argument,') returned', returnValue) argument = 10 returnValue = isOdd( argument ) print( 'isOdd(',argument,') returned', returnValue) if __name__ == '__main__': main()Note, after completing the function, the provided code should display just the following:
isOdd( 5 ) returned True isOdd( 10 ) returned FalseNote, any time the assignment is to write a function that returns a value, then you can apply this same technique of writing a main function, calling the function that you're asked to write and displaying the result. Make sure you selectively calling the main function with:
if __name__ == '__main__': main()
Complete the canDivideNoRem() function so that it takes a dividend and divisor and returns True if the division operation can be done without a remainder and False if not.
Examples:
canDivideNoRem(44, 4) returns True
canDivideNoRem(20, 3) returns False
def canDivideNoRem():
Complete the biggest() function so that it takes 4 numbers and returns the biggest one. Assume all values are unique (no duplicate numbers).
Examples:
biggest(35, 32, 1, 9) returns 35
biggest(4, 9, 45, 3) returns 45
def biggest():
Complete the smallest() function so that it takes 4 numbers and returns the smallest one. Assume all values are unique (no duplicate numbers).
Examples:
smallest(35, 32, 1, 9) returns 1
smallest(4, 9, 45, 3) returns 3
def smallest():
Complete the middle() function so that it takes 3 numbers and returns the middle value.
Assume all values are unique (no duplicate numbers)
Examples:
middle(35, 1, 32) returns 32
middle(14, 9, 45) returns 14
def middle():
Complete the letterGrade() function so that it takes a number score and returns a letter grade. Use the following scale:
90 or above: 'A'
80-89: 'B'
70-79: 'C'
60-69: 'D'
<60: 'F'
Examples:
letterGrade(75) returns 'C'
letterGrade(98) returns 'A'
letterGrade(55) returns 'F'
def letterGrade():
Complete the zipZapZop() function so that it requests an integer from the user. The function should display a response following this pattern:
Example 1:
Enter a number: 5 zap
Enter a number: 15 zipzap
Enter a number: 2 2
def zipZapZop():
Complete the speeding() function so that it takes 1) a speed and 2) a speed limit. Have the function return the total fine according to the following:
If someone is caught speeding, it is a $50 fine plus $4 for each MPH over the speed limit.
If the speed is 90 MPH or more, add another $150 fine.
If there is 25 MPH or more difference between the speed and speed limit add another $300 fine.
If someone was not speeding, the function should return: No speed violation
Examples:
speeding(75, 60) returns 110
speeding(90, 75) returns 260
speeding(50, 25) returns 450
speeding(35, 40) returns 'No speed violation'
def speeding():