In Python 3.8.5 Shell on Linux, I have a list named "mixedlist" (see below) that contains an integer, a floating point, and a string. As we can see, the integer 1 is contained in ''mixedlist'', whereas the number 1.1 is not. So far so good. What I don't understand: oddly, Python also returns 'True' for the floating point number 1.0 , even though the list only contains an integer 1. I assume this is not a bug but a feature. But if this is the expected behaviour, could someone point out why it makes sense?
>>> mixedlist = [1, 2.3, 'blabla']
>>> type(mixedlist[0])
<class 'int'>
>>> type(mixedlist[1])
<class 'float'>
>>> type(mixedlist[2])
<class 'str'>
>>> 1 in mixedlist
True
>>> 1.0 in mixedlist
True
>>> 1.1 in mixedlist
False
>>> 'blabla' in mixedlist
True