Last active
November 11, 2021 07:49
-
-
Save scriptorluminary/b32d2e707bf1f48eb821155c39477e83 to your computer and use it in GitHub Desktop.
In Python, floating‐point numbers and integers with the same value are equal in comparisons, but possibly not in other programming languages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integer = 5 | |
floating = 5.0 | |
result = False | |
if integer == floating: | |
result = True | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment