Question: Lab 1 1 A: All math, all the time Write a method allMath ( ) which takes in two numbers as inputs and returns a
LabA: All math, all the time
Write a method allMath which takes in two numbers as inputs and returns a tuple containing the result of each arithmetic operation between both numbers in the following order: addition, subtraction, multiplication, division, floor division, modulus, power. If one of the operations requires a division by replace its result with None For example:
allMath would return the tuple
allMath would return the tuple
allMath would return the tuple None, None, None,
allMath would return the tuple
Outside the method, prompt the user for two numbers, pass those two numbers to allMath, and then print out the result, as the sample outputs below show.
Note: You can assume both inputs are valid numbers ie you dont need to check if the inputs are numbers
Hint: Remember that, while tuples are immutable, you can concatenate two tuples, much like you would two strings.
Sample outputs user input in bold:
Enter your first number:
Enter your second number:
Your resulting tuple is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
