Question #171

What it the output of the code snippet below?
print(float("inf") == float("infinity"))

That is true! The function float() works with both "inf" and "infinity" . Also, Python considers that float("inf") and float("inf") are equal as described with the __eq__() method. (blog.usejournal.com/how-to-work-with-infinity-in-python-3...)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵