-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpbj.py
More file actions
25 lines (19 loc) · 932 Bytes
/
pbj.py
File metadata and controls
25 lines (19 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
slices_of_bread=2
has_peanut_butter=True
has_jelly=True
if slices_of_bread>=4:#Note: I have enough bread to make multiple sandwiches.#
print "You can make {0} sandwiches.".format(slices_of_bread/2)
if has_peanut_butter==True and has_jelly==False:
print "You can make a peanut butter sandwich."
elif (has_peanut_butter and has_jelly==True):
print "You can make a peanut butter and jelly sandwich."
elif slices_of_bread==2:#Note: I have enough bread to make one sandwich.#
print "You can make {0} sandwich.".format(slices_of_bread/2)
if has_peanut_butter==True and has_jelly==False:
print "You can make a peanut butter sandwich."
elif (has_peanut_butter and has_jelly==True):
print "You can make a peanut butter and jelly sandwich."
elif slices_of_bread<2:
print "You can't make any sandwiches."
else:
print "You might be able to make half sandwiches."