Dictionary of mosaic

# Dictionary Mosaic 
DIC = { "name": [ "Apple", "Banana", "Grape"], 
     "Information": {. 1: "Sweet", 2: "delisious",. 3: "The sour"}, 
     " Hobby ":" Fruit ", 
     " Age ": 18 is 
    } 

Print (DIC) 
Print (DIC [" name "] [0] .upper ()) 
DIC [" name "] (Red Grape") the append. " 
Print (DIC ) 
DIC [ "Age"] = 99 
Print (DIC) 
DIC [ "Information"] [. 4] = "the I like IT" 
Print (DIC [ "Information"] [. 4]) 
# K value of the dictionary are immutable data type : str, tuple, int, Bool 
# and value can be any type of data

  

Guess you like

Origin www.cnblogs.com/GZ1215-228513-Chichy/p/11320371.html