Equal Sign Question


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

I just realize you aren’t able to put a equal sign on the right hand side of the equation, such as meal+meal*tips=meal. Is this with the real application, or is it only Codecademy? Why is it like that?

```python

Replace this line with your code.

<do not remove the three backticks above>

#2

This is called a bad assignment because the expression is on the left side when it should be on the right. Assignment is always from right to left. This is the case in all languages, not just Python, and not just at Codecademy.


#3

One could design a programming language in which the value of an expression on the left is assigned to a variable to the right of an assignment operator. However, it is nearly universal among programming languages to place the target variable to the left of the assignment operator.

TI BASIC is a rare exception …

:16→A        "Store the value of 16 into variable A."
:B+1→B       "Increment the relative value of B by 1."
:−1.3+4.9i→Θ "Store the value of negative 1.3 plus 4.9i into variable theta (Θ)."

Source: Wikipedia: TI-BASIC.


#4

Yes, I was sure there would be something out there that would eschew my words. Glad you pointed this out. Assembler also came to mind and very closely resembles your TI, above.


#5

We’ll need to watch for the debut of a Codecademy beta course on TI-BASIC. :grin:


#6

Oh thanks for pointing it out. :slight_smile: :blush:


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.