FAQ: Code Challenge: Python Functions - All Operations

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:

Data Science

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 (reply) below!

Agree with a comment or answer? Like (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!

1 Like

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?

9 posts were split to a new topic: How does indentation need to match up?

3 posts were split to a new topic: Why don’t I need to use a string to print?

2 posts were split to a new topic: Setting a variable to print?

3 posts were split to a new topic: I found a fluke in passing the lesson?

Is this a specific algorithm or is this jus a lot of math ? :smiley:

You decide…

https://en.wikipedia.org/wiki/Modulo_(jargon)

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?

lots_of_math()

1.

Create a function named lots_of_math() . This function should have four parameters >named a , b , c , and d . The function should print 3 lines and return 1 value.

First, the sum of a and b .

Second, d subtracted from c .

Third, the first number printed, multiplied by the second number printed.

Finally, it should return the third number printed mod a

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.