-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDictpdt.py
More file actions
21 lines (21 loc) · 759 Bytes
/
Dictpdt.py
File metadata and controls
21 lines (21 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
n = int(input("Enter the number of Products:"))
price = dict()
for i in range(0, n):
product_name = input("Enter the name of product:")
price[product_name] = int(input("Enter its price:"))
print("Shop is ready")
print("Check for the availability of product")
while True:
check_product = input("Enter the product or q to exit:")
if check_product == "q" or check_product == "Q":
break
if check_product in price:
print("Price of", check_product, "is", price[check_product])
else:
print(check_product, "not available")
print("Checking the price list")
amount = int(input("Enter the amount:"))
print("Products below the price", amount, "is")
for i in price:
if price[i] < amount:
print(i, ":", price[i])