Skip to content

Instantly share code, notes, and snippets.

@nicholsonjf
Last active December 19, 2015 14:48
Show Gist options
  • Save nicholsonjf/5971400 to your computer and use it in GitHub Desktop.
Save nicholsonjf/5971400 to your computer and use it in GitHub Desktop.
I'm planning a friend's bachelor party. 16 people are invited. To RSVP and come, the price is $150. If you can't come but still want the t-shirt we designed for the bachelor party, it's $35. This Python function calculates what the return is depending on how many people RSVP and how many only buy the shirt.
def steve(x,y):
"""where x is buyers of shirts and y is number of RSVPs"""
js = x * 35
rsvp = y * 150
total = jt + rsvp
print "Money from shirts: $" + str(js)
print "Money from RSVPs: $" + str(rsvp)
print "Total: $" + str(total)
steve(7,9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment