Re: [Tutor] Quick Question on String Compare

2013-06-01 Thread Danny Yoo
The standard sorting in Python depends on a comparison operator. A quick and easy comparison operator that Python uses for strings is lexicographic ordering: http://en.wikipedia.org/wiki/Lexicographical_order The quick and dirty rule is: dictionary order, with each character consistently tre

Re: [Tutor] Quick Question on String Compare

2013-06-01 Thread Andreas Perstinger
On 01.06.2013 07:47, Sarma Tangirala wrote: I had a quick question on how string compare works. If did '1001' <= '999' I get true. I know how the string compare works but I was wondering why it were so. Why doesn't the string length factor into the comparison? Because usually you are interested

Re: [Tutor] Quick Question on String Compare

2013-06-01 Thread Peter Otten
Sarma Tangirala wrote: > I had a quick question on how string compare works. If did '1001' <= '999' > I get true. I know how the string compare works but I was wondering why it > were so. Why doesn't the string length factor into the comparison? For > example, If I compared character-by-character

[Tutor] Quick Question on String Compare

2013-05-31 Thread Sarma Tangirala
Hi, I had a quick question on how string compare works. If did '1001' <= '999' I get true. I know how the string compare works but I was wondering why it were so. Why doesn't the string length factor into the comparison? For example, If I compared character-by-character but also found how differen