Created
October 19, 2013 16:23
-
-
Save ayota/7058040 to your computer and use it in GitHub Desktop.
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 sandwich (Slices, HasPeanutButter, HasJelly): | |
Bread = Slices/2 | |
HasPeanutButter = HasPeanutButter | |
HasJelly = HasJelly | |
if Bread >= 1 & HasPeanutButter == True: #check for enough bread | |
if Bread >= 2: #assign plural or not plural | |
Plural = "es" | |
else: | |
Plural = "" | |
if HasJelly == True: #check for jelly | |
Jelly = " and jelly." | |
else: | |
Jelly = "." | |
print "You can make {0} sandwich{1} with peanut butter{2}".format(Bread,Plural,Jelly) | |
else: | |
print "Go to the store." | |
sandwich(2456, True, True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment