Python Value Assignment Operators

by Atakan

In this section, we will examine the topic of assigning variables.
In Python, assigning a value to a variable is with the value to be assigned on the right and the variable name on the left.

must be like;
my_var = “myvalue”

value assignment operators

OperatorShort WayNormal Way
=my_var = 5my_var = 5
+=my_var +=3my_var = my_var + 3
-=my_var -=3my_var = my_var – 3
*=my_var *=3my_var = my_var * 3
/=my_var /=3my_var = my_var / 3
%=my_var %=3my_var = my_var % 3
**=my_var **=3my_var = my_var ** 3

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. OK Read More