print 'xxx' > 'ssaww'
it print 'true'
who can give me a clear example .
thanks
print 'xxx' > 'ssaww'
it print 'true'
who can give me a clear example .
thanks
Just like in math, > compares two operands and returns True if the left operand is greater than the right, otherwise False.
you can test it out on the interpreter
>>> 'xxx'>'yyy' #first character 'x' is less than first character 'y', so false
False
>>> 'xxx'>'xyy'
False
>>> 'xyy'>'xyx' #3rd character 'y' is greater than 3rd character 'x', so true
True
It can do y>x>z as a nicer way to say y>x and x>z.
As others have mentioned its a simple greater-than comparison (in your case for strings).