Danny Yoo said unto the world upon 2005-03-11 16:07:

On Fri, 11 Mar 2005 [EMAIL PROTECTED] wrote:

<SNIP>

When we ask: "Is the number 'one' greater than the number 'two'?", Python
is telling us "No!" by giving us back the value 'False'.  Whenever we ask
Python a question that's a yes/no sort of thing, Python will respond with
a value like 'True' or 'False'.


We can also compare strings to see if a word is "bigger" than another word, based on where it might be located in a dictionary. For example:

###

"application" < "applied"

True

"applied" < "application"

False ###

A slight refinement of what Danny said: for strings, comparisons determine which string is "bigger" based on a concept of `dictionary order' where x is `bigger' than y if it comes later in a dictionary which puts uppercase letters before lower case ones.


Hence:

>>> 'z' < 'a'
False
>>> 'Z' < 'a'
True
>>>

Best,

Brian vdB

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to