Answers for "how to get values from a dictionary python"

1

dictionary in python

my_dict = {"key": "value", "a": 1, 2: "b"}
print(my_dict["key"])
# Output: value
print(my_dict["a"])
# Output: 1
print(my_dict[2])
# Output: b
Posted by: Guest on January-30-2021

Code answers related to "how to get values from a dictionary python"

Python Answers by Framework

Browse Popular Code Answers by Language