Aug-08-2019, 08:57 PM
(This post was last modified: Aug-08-2019, 08:57 PM by jefsummers.)
arithmetic: +, -, *, /, ** (exponentiation), % (modulus), // (floor division, or integral part of a division)
assignment: =
Oddball: +=, -= shorthand assignment, a += 1 is shorthand for a=a+1. The plus is arithmetic, the equal is assignment.
Do not confuse with logical operator ==, which is used in comparisons as "is equal to"
if a == 1:
For a website with examples:
https://www.tutorialspoint.com/python/py..._operators
assignment: =
Oddball: +=, -= shorthand assignment, a += 1 is shorthand for a=a+1. The plus is arithmetic, the equal is assignment.
Do not confuse with logical operator ==, which is used in comparisons as "is equal to"
if a == 1:
For a website with examples:
https://www.tutorialspoint.com/python/py..._operators