Guest User

Untitled

a guest
Jan 16th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. bread = 10
  2. peanut_butter = 20
  3. jelly = 30
  4. if bread > 1 and peanut_butter >= 1 and jelly >= 1:
  5. sandwiches = bread/2
  6. print "I can make {0} PBJ sandwiches today.".format(sandwiches)
  7. elif bread % 2 and peanut_butter >=1 and jelly >= 1:
  8. print "I can make an open face sandwich"
  9. elif bread > 1 and peanut_butter >= 1 and jelly == 0:
  10. bpsandwiches = min(bread/2,peanut_butter)
  11. print "I can make {0} peanut butter sandwiches".format(bpsandwiches)
  12. elif bread > 1 and jelly >= 1 and peanut_butter == 0:
  13. bjsandwiches = min(bread/2,jelly)
  14. print "I can make {0} jelly sandwiches".format(bjsandwiches)
  15. else:
  16. if bread < 2:
  17. print "you need more bread"
  18. if jelly < 1:
  19. print "You need more jelly"
  20. if peanut_butter < 1:
  21. print "You need more peanut_butter"
Add Comment
Please, Sign In to add comment