Skip to content

Instantly share code, notes, and snippets.

@VMois
Created October 24, 2023 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VMois/389dd55b60d5094391bb6c643f3e9bc4 to your computer and use it in GitHub Desktop.
Save VMois/389dd55b60d5094391bb6c643f3e9bc4 to your computer and use it in GitHub Desktop.
Python types are not strict (code snippet for GDSC BME event)
def do_things(a: int, b: int) -> int:
return a + b
print(do_things(2, 3))
print(do_things("hello", " world!"))
# print(do_things(2, " world!")) # this will throw an exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment