In the following example, print statement is evaluated with the output "test".
x = [3]
if x != 3:
print("test")
But I don't understand how this works. Is the value x assigned to the address of the list [3] and therefore x != 3 evaluates to True? Because my intuition says that I should get an Error here since you can't compare a list to an int.
3 != [3]is true, because they're different types.False == 0 == 0.0