Created
July 12, 2017 07:10
-
-
Save porimol/d1db153ee047a11a183ab96c9e6886f6 to your computer and use it in GitHub Desktop.
Python type hinting example
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
def greeting(name: str)->int: | |
return "Hello "+name | |
# funtiom calling with correct parameter type | |
greeting("Porimol") | |
# function calling with wrong parameter type | |
greeting(420) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment