I am an absolute beginner in python and I would like to know what the difference is between = and ==.
I noticed that = and == seem replaceable when defining numeric variables, but not for boolean variables.
Any clarifications would be helpful. For example, for this program
my_int = 7
my_int == 3
print my_int
This does not replace the value 3 of the variable, whereas if I set
my_int== 7
my_int=3
it replaces the value 7 with 3.
Please explain how these operators work. thank
source
share