Computer Science, asked by kushbhu0808, 4 months ago


16.Write a program that repeatedly asks the user to enter product name names and prices. Store all of
these in a dictionary whose keys are the product names and whose values are the prices

Answers

Answered by shantanukumar9686
2

Answer:

Python's dictionary class has three methods for this purpose. The methods items(), keys() and values() return view objects comprising of tuple of key-value pairs, keys only and values only respectively. The in-built list method converts these view objects in list objects.

Answered by jai696
5

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

prices = {}

while True:

product, price = input("product: "), float(input("price: "))

prices[product] = price

print(prices)

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions