Answers for "how to get the value out of a dictionary python3"

1

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
Posted by: Guest on April-16-2020

Code answers related to "how to get the value out of a dictionary python3"

Python Answers by Framework

Browse Popular Code Answers by Language