Python‎ > ‎operator‎ > ‎

operator.gt()

http://www.adilwaseem.com/

Definition
Return with the True or False whether first value is greater than other.

Syntax 
operator.gt(a,b)
a>b
__gt__

Parameters
a,b=values

Import module
Importing module is required in the Shell window and the Editor window.

Examples
Return the True or False.
 >>> a=45**2
>>> b=3**6
>>> operator.gt(a,b)
True
>>> operator.gt(b,a)
False

a>b
Return with the results.
>>> a>b
True
>>> b>a
False

operator.__gt__(a,b)
The method return the same value.
 >>> operator.__gt__(a,b)
True
>>> operator.__gt__(b,a)
False

Comparing two value through pow() and operator.ipow():
 >>> import operator
>>> a=operator.ipow(3,4)
>>> b=pow(3,4)
>>> a.__gt__(b)
False

__gt___
The method test whether the set1 is greater than set2.
 >>> set1={4,5,6,7}
>>> set2={6,7,8,9,10}
>>> set1.__gt__(set2)
False


Comments