Write a program to prompt the user to enter the product to be bought. After accepting the product,
the user to provide the quantity to be bought also.
first to answer marked as the brainliest. :D
Attachments:
Answers
Answered by
0
Answer:
BY PYTHON
Explanation:
PythonCSIP CS IP sa 11 cs chapter 13, sa 11 ip chapter 8
n = int(input(‘Enter number of products : ‘))
prod = {}
for i in range(n):
p = input(‘Enter product name : ‘)
prod[p] = int(input(‘Enter its price : ‘))
q = True
while q:
p = input(‘Enter product for price or q to exit : ‘)
if p == ‘q’:
break
if p in prod:
print(‘price of’, p, ‘is’, prod[p])
else:
print(p, ‘is not here’)
Similar questions