Answers for "how to get element from dictionary python"

5

python dict access

my_dict = {'name':'Jack', 'age': 26}
my_dict['name']
Posted by: Guest on March-08-2020
2

how to get element from dictionary python

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
dict['Age'] = 8; # update existing entry
dict['School'] = "DPS School"; # Add new entry

print "dict['Age']: ", dict['Age']
print "dict['School']: ", dict['School']
Posted by: Guest on August-10-2020

Code answers related to "how to get element from dictionary python"

Python Answers by Framework

Browse Popular Code Answers by Language