Python Forum
Help with dictionaries
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with dictionaries
#1
Hey buddies , I just tried to work with Dictionaries in Python but I got stuck in trouble with it .
# choose any name for the dictionary
dictShopping = {'soap': '10' , 'bread': '5' , 'shampoo': '8'}
dictSelling = {'soap': '20.50' , 'bread': '25.99' , 'shampoo': '80'}

print(' The shopping center have {} quantities of bread which costs {} dollars . '.format(dictSelling,soap))
I don't know to to get along with this code to make my program run as well .

I just wanted to do these with my codes :

.Display the item with quantity and the cost of item in a single line like

The shop have 10 quantities of soap which cost 20.50 USD each.

So I'll be very happy if you can help me with this .
Thanks
Reply


Messages In This Thread
Help with dictionaries - by erfanakbari1 - Feb-28-2019, 07:48 AM
RE: Help with dictionaries - by Larz60+ - Feb-28-2019, 09:10 AM
RE: Help with dictionaries - by borrowedcarbon - Feb-28-2019, 05:06 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020