This community-built FAQ covers the “All Operations” exercise from the lesson “Code Challenge: Python Functions”.
Paths and Courses
This exercise can be found in the following Codecademy content:
FAQs on the exercise All Operations
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
Agree with a comment or answer? Like () to up-vote the contribution!
Need broader help or resources? Head here.
Looking for motivation to keep learning? Join our wider discussions.
Learn more about how to use this guide.
Found a bug? Report it!
Have a question about your account or billing? Reach out to our customer support team!
None of the above? Find out where to ask other questions here!
4 posts were merged into an existing topic: What is mod short for in math?
7 posts were split to a new topic: Should I use return or print()?
2 posts were split to a new topic: Is this code alright?
2 posts were split to a new topic: Setting a variable to print?
Is this a specific algorithm or is this jus a lot of math ?
Thanks for the link, the history of modulo is very interesting but it was not what I was looking for. The problem is with my question. Let me clarify my question because you’re going to get an answer that is as good as your question. In the Code Challenge : Python Functions, Lots of Math it asks to create a function as shown below. The code challenge is asking you to create an algorithm inside the function by adding a to b and subtracting d from c and then multiplying the results together. Is this particular algorithm of any importance mathematically or is it just lots of math?
Create a function named
lots_of_math() . This function should have four parameters >named
c , and
d . The function should print 3 lines and return 1 value.
First, the sum of
d subtracted from
Third, the first number printed, multiplied by the second number printed.
Finally, it should return the third number printed mod
Practice and exercise, with a little bit of arithmetic that is none too difficult if we know how to add, subtract, multiply and find a remainder in division. It’s also a test on how well we can follow instructions.
Instruction is added bonus to help us learn and cement concepts so that eventually we can tackle problems on our own steam.