FAQ: Learn Python - Python Syntax - Arithmetic

This community-built FAQ covers the “Arithmetic” exercise in Codecademy’s lessons on Python.

FAQs for the Codecademy Python syntax exercise Arithmetic

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about Python in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

  • This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
  • Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
  • This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!

Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

A post was split to a new topic: Question about arithmetic

A post was split to a new topic: Math in Python

2 posts were split to a new topic: Why didtn’t my remainder show on the screen?

A post was split to a new topic: Why are there no quotes in arithmatic?

2 posts were split to a new topic: How do I get arithmatic to post results?

i don’t understand anything, what im i supposed to do

1 Like

2 posts were split to a new topic: Math using Python 2

why is “5 * 5 = product = 25” and “5 x 5 = product = 25” wrong? I don’t understand this at all

Programming languages have their own syntax and rules.
In Python, * is used for multiplication. x is not a valid operator. In mathematics, x can be used to denote multiplication, but not in Python.

Also, the = operator means something different in Python. In mathematics, = is used for equality. In Python, = doesn’t denote equality, rather it is the assignment operator. In Python, == is used for equality.

The correct syntax is that the expression/calculation should be to the right of the = operator. The variable to which we want to assign the result should be to left of the = operator.

// Valid
product = 5 * 5  

// Invalid
5 * 5 = product 

// Invalid
product = 5 x 5

in the python syntax module the instructions are not clear about what the exercise wants you to do. I’m clicking the hints and asked my classmate, but the lack of directions makes it very difficult to even know what the task is.

1 Like