1#The (!) is the not operator in Python, (!=) means not equal to.
2if 2!=10:
3 print("2 isn't equal to 10.")
4elif 2==10:
5 print("2 is equal to 10.")
6#Prints "2 isn't equal to 10." as 2 isn't equal to 10. Is it?
7
8#Note that "=" is used for declarations (assign a value to a variable or change the value of one) while "==" is usually used for checking.
9#Usually, "==" returns a boolean, but depends on the objects being checked if they're equal or not, that the result will be boolean.
10#For example, some NumPy objects when checked will return values other than boolean (other than True or False).
11
12#For example:
13
14a = 10
15print(a)
16
17#will return the int 10
18#Now,
19
20print(a==10)
21
22#will return a boolean, True as we have assigned the value of a as 10
23
24#Another example (to make it easier and to avoid confusion) would be where
25
26a = 10
27b = 10
28
29#and
30
31print(a==b)
32
33#will return a boolean, True as they're equal.
34
35