= python meaning code example

Example 1: x and y in python

x = 10
y = 12

# Output: x > y is False
print('x > y is',x>y)

# Output: x < y is True
print('x < y is',x<y)

# Output: x == y is False
print('x == y is',x==y)

# Output: x != y is True
print('x != y is',x!=y)

# Output: x >= y is False
print('x >= y is',x>=y)

# Output: x <= y is True
print('x <= y is',x<=y)

Example 2: * meaning in python

The * in python represents "The rest".
Meaning it will take the remaining arguments that are left over in your 
code and fit inside the variable OR you can use it as your primary 
variable to store as many arguments that you want.
After doing this it it will convert them into a list.

Example 3: //= 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

Tags: