Skip to content

Python code snippet – How to get data from dictionary?

teas = {
	'english_breakfast': 104,
	'matcha_green_tea': 26,
	'green_tea': 29,
	'decaf_english_breakfast': 51,
	'assam': 48
}

matcha = teas.get('matcha_green_tea')

print(matcha)
See also  Python code snippet - How to remove a string inside another string ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.