Successfully reported this slideshow.
Your SlideShare is downloading. ×

dictionary output.pptx

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
variable assignment.pptx
variable assignment.pptx
Loading in …3
×

Check these out next

1 of 1 Ad

More Related Content

Recently uploaded (20)

Advertisement

dictionary output.pptx

  1. 1. Output: Create a Dictionary and perform the following methods 1) Print Dictionary Items 2) Access Items 3) Use get() 4) Change Values 5) use len() ────────────────────────────── Enter the State and its Capitals for 3 states Enter State: Karnataka Enter Capital: Bangalore Enter State: Goa Enter Capital: Panjim Enter State: Tamil Nadu Enter Capital: Chennai ──────────────────────────────────── Method 1: Printing the dictionary The Created Dictionary is: {'Karnataka': 'Bangalore', 'Goa': 'Panjim', 'Tamil Nadu': 'Chennai'} ──────────────────────────────────── Method 2: Access Items The Items in the dictionary are: dict_items([('Karnataka', 'Bangalore'), ('Goa', 'Panjim'), ('Tamil Nadu', 'Chennai')]) ──────────────────────────────────── Method 3: Using get() Enter a State Name to get its Capital: Goa The Capital of: Goa is: Panjim ──────────────────────────────────── Method 4: Change Value Enter a State to change its Capital: Karnataka Enter the Capital: Bengaluru The updated Dictionary is: {'Karnataka': 'Bengaluru', 'Goa': 'Panjim', 'Tamil Nadu': 'Chennai'} ──────────────────────────────────── Method 5: Use len() The Length of the Dictionary is: 3 ───────────────────────────────────

×