Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Python :: round off float to 2 decimal places in python 
Python :: droping Duplicates 
Python :: read a file with pandas 
Python :: kivy button on click 
Python :: convert timestamp to date python 
Python :: python read json file array 
Python :: label change in tkinter 
Python :: python find difference between lists 
Python :: python youtube download mp3 
Python :: replace outliers with nan python 
Python :: measure time 
Python :: get ip address py 
Python :: create a dictionary from a list python 
Python :: django response headers 
Python :: python cocktail sort 
Python :: difference between set and tuple in python 
Python :: python check if list contains 
Python :: intellij python 
Python :: unique values in dataframe column count 
Python :: install aws sdk python 
Python :: pyqt5 qtreewidgetitem enable drop drag 
Python :: python series 
Python :: word2number python 
Python :: python subtract every element in list 
Python :: django environment variables 
Python :: seaborn iris dataset 
Python :: user defined functions python 
Python :: count consecutive values in python 
Python :: seed python 
Python :: integer xticks 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =