Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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']
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #element #dictionary #python
ADD COMMENT
Topic
Name
9+1 =