-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPT_conditional01.py
More file actions
30 lines (24 loc) · 1.17 KB
/
PT_conditional01.py
File metadata and controls
30 lines (24 loc) · 1.17 KB
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
26
27
28
29
30
""" Challenge
Author:
Description: Aling Nena stores her soft drink stock on two refrigerators.
She stores Coke, Sprite and Royal on her Sari-sari store's refrigerator while
RC and 7UP can be found on her house's refrigerator.
Help Aling Nena to properly respond to her customer
when buying softdrinks.
The reply will depend if the soft drink brand is on the store's ref,
on the house's ref or none. If the customer buys a soft drink brand that is:
1. stored on the store, she will respond 'Got it!'
2. stored on the house, she will respond 'Please wait for a while!'
3. not sold by her, she will respond 'Sorry we do not sell that. We only
have <input here the soft drink brands>'
"""
customer_order = input('Hi! What soft drink brand do you want? ')
print ('Your Order : '+customer_order.upper())
storeDrinks = ['Coke','Sprite','Royal']
homeDrinks = ['RC','7UP']
if customer_order.lower() in (a.lower() for a in storeDrinks):
print ('Got it!')
elif customer_order.lower() in (a.lower() for a in homeDrinks):
print ('Please wait for a while!')
else:
print('Sorry we dont sell that. We only have '+', '.join(storeDrinks),', '.join(homeDrinks))