1

could anyone help me with tranforming dictionary values into a tuple please. The dictionary:

dic = {'a': 1, 'b':2, 'c':3, 'd':4}

and im looking to get output only values as tuple:

tup = (1, 2, 3, 4)

1 Answers1

0

Just access the dict values, then make it a tuple:

dic = tuple(dic.values())

Julio S.
  • 944
  • 1
  • 12
  • 26