Skip to content

Instantly share code, notes, and snippets.

@korkridake
Created December 5, 2018 14:49
Show Gist options
  • Save korkridake/8864d21edcefcd38f1eba151963e7693 to your computer and use it in GitHub Desktop.
Save korkridake/8864d21edcefcd38f1eba151963e7693 to your computer and use it in GitHub Desktop.
def rectangle(w, h): # dynamic typing
# code block
area = w * h
return area
def triangle(w, h):
# area = .5 * w * h
return .5 * w * h
# main entry point
w = int(input("width = ")) # string '5' "5"
h = int(input("height = ")) # "3"
# print(rectangle(w, h))
print(triangle(w,h))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment