0

I have a switch case statement, in which I pick tupple of various lengths.

choices = {'a': ('apple'), 'b': ('peas', 'beet')}
result = choices.get(key, 'default')
print(len(result)) 

#Output key :a gives 5(not 1, this is what I want), b gives 2.

How do I achieve this?

Carcigenicate
  • 43,494
  • 9
  • 68
  • 117

0 Answers0