Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to get the value out of a dictionary python3

#!/usr/bin/python3 

dict = {'Name': 'Zara', 'Age': 27}

print ("Value : %s" %  dict.get('Age'))
print ("Value : %s" %  dict.get('Sex', "NA"))

# Value : 27
# Value : NA
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #dictionary
ADD COMMENT
Topic
Name
2+8 =