Python Forum

Full Version: stupid > comparison question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a list with a value of 4 at index 2. I compare this with a value of 200 to see if it is greater ... and strangely it says it is:

eg
print deltaList[2], thr2nd, deltaList[2] > thr2nd
I get this output: 4 200 True

This is obviously wrong but what am I doing wrong ?

Regards Undecided
There are no stupid questions, knowing that a question has to be asked shows intelligence!
add:
print('datalist[2]: {}, thr2nd: {}'.format(datalist[2], thr2nd))
To be really sure they contain what you think they contain.
oops it was a string - stupid 8 year olds mistake !
thanks anyway