Skip to content

Instantly share code, notes, and snippets.

@rafkhan
Last active December 11, 2015 00:58
Show Gist options
  • Save rafkhan/4519731 to your computer and use it in GitHub Desktop.
Save rafkhan/4519731 to your computer and use it in GitHub Desktop.
a = input("w: ")
b = input("h: ")
print a * b
a = input("w: ")
b = input("h: ")
print a * b
a = input("w: ")
b = input("h: ")
print a * b
a = input("w: ")
b = input("h: ")
print a * b
def calc_area(a, b):
c = a * b
return c #or you coul just return a * b
print calc_area(1, 3)
print calc_area(3, 5)
x = calc_area(5, 5)
y = calc_area(3, 2)
total = x + y
print "The total area of a 5x5 square, and a 3x2 rectangle is %d" % (total)
def print_area(a, b):
print a * b
print_area(23, 43)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment