Can somebody explain to me the following (python 2.7)
Two string numbers, from a parsed file:
‘410.9’
‘410.9 ‘ (Notice the trailing space)
A_LIST = ['410.9 ']
'410.9' in '410.9 '
True
'410.9' in A_LIST
False
No problem working around this – just trying to understand why it is so.
Thanks!
This is correct behavior because:
and when you cheking list for a membership of a certain item you are actually doing something like that: