Answer to Question #283873 in Python for kkk

Question #283873

Write a program that asks the user to enter the products that are bought and their price


Then to write the price that he wants to sell


Every product should have a name, price, tax, profit limit


In addition, when a customer enters to buy many items the program should output the bill


At the end of every month, there should be a calculation of the gained and lost money.



1
Expert's answer
2021-12-31T01:42:01-0500
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’)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS