Wednesday, 4 January 2017

PYTHON-math calculations >,<,<=,>= based on ()

>>> 1+2*3
7


>>> (1+2)*3
9

>>> 4-40-3
-39

>>> 4-(40-3)
-33

>>> print("which is great",5>2)
which is great True

>>> print("5 > 2 which is great",5>2)
5 > 2 which is great True

>>> print("5>=2 Is it greater or equal",5>=2)
5>=2 Is it greater or equal True

>>> print("5<=2 is it less or equal",5<=2)
5<=2 is it less or equal False

>>> print("2<1 which is less",2<1)
2<1 which is less False


>>> (4<2)
False

>>> (4>2)>(1>2)
True

HERE ONLY (1>2) GET EXECUTE AND RETURN THE RESULT

>>> (1>2)>(4<2)
False
>>> (1<2)>(4<2)
True
>>> (1>2)>(4>2)
False
>>> (1<2)>(4<2)
True

No comments:

Post a Comment