Answers for "how to print out one of the key of dict"

6

python dict print keys

print(dictionary.items()) #prints keys and values
print(dictionary.keys()) #prints keys
print(dictionary.values()) #prints values
Posted by: Guest on February-20-2021
0

print specific key in dictionary python

fruit = {
    "banana": 1.00,
    "apple": 1.53,
    "kiwi": 2.00,
    "avocado": 3.23,
    "mango": 2.33,
    "pineapple": 1.44,
    "strawberries": 1.95,
    "melon": 2.34,
    "grapes": 0.98
}

for key,value in fruit.items():
     print(value)
Posted by: Guest on June-05-2021

Code answers related to "how to print out one of the key of dict"

Python Answers by Framework

Browse Popular Code Answers by Language