Using the PEP 8 machine. Create a function that takes 2 arguments and returns a result. When I say function I mean that the parameters and the return value are passed on the stack . You code must have a function and a main program that calls the function using the stack. Assignment will not be accepted if you are not passing parameters and return value in the stack. Please note a complete "pass by stack" example is below. The function adds two numbers. Feel free to use that as starter code.
Using the PEP 8 machine.
Create a function that takes 2 arguments and returns a result.
When I say function I mean that the parameters and the return value are passed on the stack .
You code must have a function and a main program that calls the function using the stack.
Assignment will not be accepted if you are not passing parameters and return value in the stack.
Please note a complete "pass by stack" example is below. The function adds two numbers. Feel free to use that as starter code.
The function you do should be one of three operations:
1) multiply - return the product of the two factors
2) divide - return the quotient ( integer arithmetic )
3) remainder / modulo - return the remainder of the division of the two factors.
Step by step
Solved in 3 steps