!= meaning python code example

Example 1: //= python meaning

#Performs floor-division on the values on either side. Then assigns it to the expression on the left.
>>> a=6
>>> a//=3
>>> print(a)
2

Example 2: what does == mean in python

# in python == means that is a comparisson operator meaning it compares if one 
# variable equals the other. Instead of using one = since that will assign
# a value we use ==

Example 3: what does == mean in python

if a == 2: # Compares whether a is equal to 2
    print a

Tags: