How to Return Values of a Dictionary in Python


In this example, we will learn how to return values of a dictionary using the values() method in Python.

Source Code

mydict = {
  'name': 'Steven',
  'age': 24,
  'ID': 123456
}

for x in mydict.values():
  print(x)

Output:

Steven
24
123456
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments