Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bread = 10
- peanut_butter = 20
- jelly = 30
- if bread > 1 and peanut_butter >= 1 and jelly >= 1:
- sandwiches = bread/2
- print "I can make {0} PBJ sandwiches today.".format(sandwiches)
- elif bread % 2 and peanut_butter >=1 and jelly >= 1:
- print "I can make an open face sandwich"
- elif bread > 1 and peanut_butter >= 1 and jelly == 0:
- bpsandwiches = min(bread/2,peanut_butter)
- print "I can make {0} peanut butter sandwiches".format(bpsandwiches)
- elif bread > 1 and jelly >= 1 and peanut_butter == 0:
- bjsandwiches = min(bread/2,jelly)
- print "I can make {0} jelly sandwiches".format(bjsandwiches)
- else:
- if bread < 2:
- print "you need more bread"
- if jelly < 1:
- print "You need more jelly"
- if peanut_butter < 1:
- print "You need more peanut_butter"
Add Comment
Please, Sign In to add comment