I have to return many variables from my function:
a = 5
b = 6
c = 8
d = 6
...
return a,b,c,d,e,f,g,h
Problem is that I would like to do it through array to save a code lines:
for (...):
ar[x] = ... # For x = a,b,c,d,e, ...
But I have to return variables in format 'return a,b,c,d,e' and I do not want to write it as:
return ar[a], ar[b], ar[c], ...
So can I use a generator for it and how? Somethig like:
return item for item in len(ar)