FAQ: Code Challenge: Python Functions - All Operations


#1

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!


#2

I’m in the Lots of Math part of Python Functions. It’s the last screen before you complete the lesson.

It is asking me to “return the third number printed mod a.” What exactly is this asking me to do?


#3

I had the same question. Mod is short for modulo, which is the % thing.


#5

I was a bit confused by this question. It says the function should print 3 lines and return 1 value - but in the “should print” part of the comments it shows all the values in one row (not just 1 value).

I did eventually get this right by just returning one value, but then it didn’t look like the suggested solution in the comments - so perhaps the phrasing was a bit odd. Or is it just me?


#6

def lots_of_math(a,b,c,d):
first = a+b
second = c-d
third = first*second
print(first)
print(second)
print(third)
return third % a

This is the code I used… is it correct? Not sure if I was supposed to do that. How do I get it all on one line?


#8

Mod means a lot for some of us, can be modules, modifications, moderations so fix this exercise asap because its confusing.