Python Forum
stupid > comparison question - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: stupid > comparison question (/thread-7458.html)



stupid > comparison question - adetheheat - Jan-11-2018

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


RE: stupid > comparison question - Larz60+ - Jan-11-2018

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.


RE: stupid > comparison question - adetheheat - Jan-11-2018

oops it was a string - stupid 8 year olds mistake !
thanks anyway