question about True values

Paul Rubin http
Wed Oct 25 21:20:53 CEST 2006


"John Coleman" <jcoleman at franciscan.edu> writes:
> > then "x == 3" is false, but "int(x) == 3" is true.
> But then why is 3.0 == 3 true? They are different types.

The 3 gets converted to float, like when you say 

  x = 3.1 + 3

the result is 6.1.



More information about the Python-list mailing list