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,740
  • 21
  • 67
  • 112

1 Answers1

1

You have to convert it into a list:

print(list(a))

Panda50
  • 901
  • 2
  • 8
  • 27