-3

I would like to return multiple outputs when I call my function. However, I do not want to return all outputs but only, say, the first, the third and the fourth from a total number of, say, 7 outputs.

I've tried s.th. like this but this leads to an error:

a, b, c = myfunc()[[0, 2, 3]]
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Michael
  • 357
  • 1
  • 13

1 Answers1

1

You can unpack the return value :

a,_, b,c,*_= myfunc()
kubatucka
  • 555
  • 5
  • 15