Possible Duplicate:
How does Python compare string and int?
I had a Python script that wasn't evaluating two values as expected. The value '10' was determined as being greater than 200. The issue was the variable holding the value of '10' was actually a string and not an integer (whereas 200 was an integer).
My question is:
What is the process Python goes through when evaluating a string against an integer? How does it make the comparison?
For example:
string="10"
int=200
if string >= int:
print("String is greater")
else:
print("Int is greater")
Would output:
String is greater
Why is this? I would have thought Python would just exit with an error when trying to compare the two types.