Deleting and Adding items to a dictionary



mydict = {
    "table" : "wood",
    "bangle" : "gold",
    "window" : "glass",
    "body" : "mud",
    "shopper" : "plastic",
    "protein" : "amino acids"
}

del mydict["protein"]
or
mydict.pop("protein")


mydict["feminine"] = "love"


 



Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

The Basic Structure of a Full-Stack Web App

Unlocking Web Design: A Guide to Mastering CSS Layout Modes