# What is mod short for in math?

## Question

What is mod short for? Particularly when written X mod Y?

mod is short for modulo, a math function that means to get the remainder of division. It is represented with a `%` in python and written `X % Y` this can be read as X mod Y or X modulo Y.
It is used to get the remained from a division. For example:

``````15 % 4 = 3
>> 15 / 4 = 12 with remainder 3
``````

For some further studying, see the Codecademy Python 3 modulo exercise.

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?

13 Likes

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

10 Likes

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

10 Likes

Finally, it should return the third number printed mod `a`, this is a poorly written step, whoever wrote this exercise, please, get down to our level, I know you are an expert, but this is the first time I learned about this word âmodâ , this exercise is confusing! you can do a better job

6 Likes

Whilst the confusion is unfortunate, modular arithmetic is a mathematical system which existed long before the computer did.

The use of `mod` in this fashion is not confined solely to programming, nor to Codecademyâs material; itâs mathematics, so youâll just have to get used to it Iâm afraid.

3 Likes

Terrible response from the Help Desk! Why make this more difficult by throwing in jargon that most donât know. You could have easily left âmodâ out and asked to return the remainder of âaâ and this thread wouldnât exist!

1 Like

Programming is difficult, and learning by its very nature is going to involve a lot of things which are âunknownâ. A good amount of your time, as a programmer, will likely be spent looking for information and learning about things you have either a) not seen before and/or b) donât fully understand.

An example would be the use of `mod` in this context: you saw it, didnât understand it, and went looking for more information to help you make sense of it before ending up here. This is a process with which you should become familiar.

I can only presume, as I do not have access to the specific exercise (since I am neither a Pro member nor a Codecademy employee), that since this exercise deals specifically with the modulo operator that the specific statement of `a mod b` is intended to prompt the use of the `%` operator you have been learning about. It also introduces you to the notation.

Otherwise, if the exercise simply asked for a remainder, you might derive some alternative mechanism for calculating it when a single operator is sufficient.

3 Likes

I agree with the prior response that this was a poorly written exercise. This is not the first time Iâve had trouble with the instructions.

1 Like

In any programming exercise, reading the instructions is crucial. It is clear enough to see what is coming in return for me.

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

2 Likes

Came here bc I was confused, and saw I wasnât alone! I if there were a previous example explained with this verbiage, I would have known what to do.

Up until this point in the exercises `%` was always referred to as modulo so if they suddenly change how they refer to `%` it they should at the very least have an explanation in the hint if not in the actual instructions.

I think the lesson designers have assumed that, given the entire exercise revolves around the use of the modulo `%` operator that youâll be able to infer that âmodâ == âmoduloâ.

The confusion is unfortunate, for sure, but I donât think itâs that great of a leap to make. Besides, in the event that is is confusing there is the secondary benefit of getting you used to going looking for answers on your own. There will not always be someone (or something) around to give you a hint or hand you the solution, and being able to successfully figure things out on your own is a useful skill.

1 Like