
In this post we will discuss about how we declared and assign a values to dictionary..
Dictionary is nothing but a bunch of values having iits key : value pair method
What is key value pair method let’s understand this with a written code below…
dic = {
'Name' : 'Google',
'Rank' : 1,
'Platform' : 'Search Engine',
}
print(dic['Name'])
Code that written above is work on key : pair method in this method keys are ‘Name’ , “Rank” , “Platform” and their values are “Google” , “1” , “Search Engine”
in the above you ” dic ” variable used to declared a dictionary variable name is always depend on user after that the print lline used to print the value of key “Name” : Google
Wheares ” Name ” is a key and its value is “Google” as writteen in code
You should copy the above code and re write your own code and what’s app us with your code…
Leave a Reply