Mathematical Operators
- 01:26
Learn how to use mathmatical operators in Python.
Downloads
No associated resources to download.
Transcript
When you are performing calculations in Jupyter Notebook using Python, almost all of the mathematical operators are going to be identical to what you use in Excel. However, be careful because not all of them are the same. See if I do 10 to the power of 10, well that doesn't make sense. It's going to give me 0 in Python. That symbol is the double asterisk is gonna be how you raise something to another power.
Additionally, you can use Python to check equality using comparison operators. Note that you check equality using the double equal sign operator, not the single equal sign operator, which has a different function.
And one quick note before we move on to using text in your output. Have you noticed these blue pieces of text following the pound sign? These are comments and the pound sign tells Jupyter Notebook or tells your Python code not to execute any text that's following on that line as code. So if I were to take this away and try to execute that, it would give me an error as invalid syntax. When I put the pound side in front of that text, it tells Python, skip over this, move on to the next line containing code and actually execute that line as code everything following this pound sign just ignore it.