0
What ia the difference between a=2 and a==2 ?
I am not understanding what is the difference between a=2 and a==2. Please help me to do that.
5 Antworten
+ 2
Hi Twiddle
A = 2
You have just created a variable, which means, A, willbe acted upon by the code as if it was 2.
Example: A * 6 = 12
A == 2
This is a comparison, which is asking, 'Is A the same as 2'
If A=2, then A==2 is a true statement.
If A = anything else, then A ==2 is a false statement
+ 2
Sorry, I didnt see python lang. in question 😁😉
+ 1
Use the searchbar, it has been asked many times.
+ 1
Maybe you mean a==2 and a===2 ?
+ 1
Ярослав Вернигора (Yaroslav Vernigora) it does not exist in python, there is only = and ==