Computer Science, asked by sandhayakumari094, 3 months ago

how to create a dictionary using the
dict() function? give an example.​

Answers

Answered by ganeshkalyank
0

If you want to create a dictionary using dict() function in Python, (say)

details = {

   'name' : 'Kalyan',

   'born' : 2004,

   'age' : 16

}

You can do that by :

details = dict(name="Kalyan", born=2004, age=16)

You can print a particular value of the dictionary by :

print(details['name'])

Hope this helps...

By the way, the details used in the question are mine... Ignore them... You can use your own details...

Have a great day...


sandhayakumari094: python
ganeshkalyank: Answer updated... Please check if you are free...
ganeshkalyank: Don't forget to mark as brainliest if it helps...
Similar questions