-4

I created a dictionary with key with multiple values. How can I access those values from single key?

d = {'a':(1,2,3),('b','c'):5}

I want to access the values 1,2 or 3 using the key 'a'.

R.Santu
  • 11
  • 2

1 Answers1

1

d['a'] is a tuple, and like any tuple you can access it's elements as such: d['a'][0] which holds the value 1

Rotem Tal
  • 739
  • 5
  • 11