Skip to content

Instantly share code, notes, and snippets.

@scriptorluminary
Last active November 11, 2021 07:49
Show Gist options
  • Save scriptorluminary/b32d2e707bf1f48eb821155c39477e83 to your computer and use it in GitHub Desktop.
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.
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