About Dictionary

..... Adding new key-value pair to dictionary
$ menu = {} # Empty dictionary
$ menu['Chicken Alfredo'] = 14.50
$ print menu['Chicken Alfredo']
$ print "There are " + str(len(menu)) + " items on the menu."
   There are 1 items on the menu.

.....Removed from a dictionary

$ del dict_name[key_name]


  

Comments

Popular posts from this blog

Basic Git Command for first time github user

Python IMAP list response, listing mailboxes, mailbox status, selecting_mailbox, searching messages, search criteria, fetching messages, whole messages, uploading messages, moving and copying messages, deleting messages, delete mailbox,search with uid