Returning variable results from a function

Matthew matthewm at zebrasoft.co.nz
Mon Apr 29 03:53:29 EDT 2002


Hi

Given something like:-

def fred(size):
    return size, 1,2,3

size,a,b,c=fred(3)

how does one create a tuple to hold the results like:-

size, (<a tuple holding the number of results?>) = fred(<no of
results?>)

Thanks so much, matthew.





More information about the Python-list mailing list