Skip to content

Instantly share code, notes, and snippets.

@nikuuchi
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save nikuuchi/976d198646e6dbcb69fa to your computer and use it in GitHub Desktop.

Select an option

Save nikuuchi/976d198646e6dbcb69fa to your computer and use it in GitHub Desktop.
型付け
def f(n):
"""(<int>|<str>) -> (<int>|<str>)"""
return n #(<int>|<str>)
def g(c, d):
"""<str> -> <int> -> <str>"""
return (c * d) #<str>
print f(1) #(<int>|<str>) -> (<int>|<str>)
print f('a') #(<int>|<str>) -> (<int>|<str>)
print g('a', 2) #<str> -> <int> -> <str>
print ['a', 'b'] #list[<str>]
print [1, 2] #list[<int>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment