+ 2
Could someone give an example of comparing strings using greater or less than operators? I'm not sure what this statement means: 'the alphabetical order of words is based on the alphabetical order of their component letters'
2 Answers
+ 14
>>> 'alien' < 'zero'
True
>>> 'monkey' > 'marriage'
True
>>> 'Zero' < 'alien'
True
It's in alfabethical order (a<b<c<....<x<y<z). Any capital letter is less than any lowercase letter (A<B<C<...<X<Y<Z<a<b<c<....<x<y<z)
+ 1
thanxx buddy.....