0

Let's say I have a dictionary below:

dict_test1 = {33: 114, 32: 14}

I want to extract out the values into a list. Desired output:

[114, 14]

My code below is returning: dict_values([114, 14]) which is not what I want

dict_test1 = {33: 114, 32: 14}

a = dict_test1.values()
print (a)

What am I doing wrong?

PineNuts0
  • 4,050
  • 16
  • 57
  • 93

1 Answers1

1

You have to convert it into a list:

print(list(a))

Panda50
  • 816
  • 2
  • 5
  • 24