Answer the question
In order to leave comments, you need to log in
How to get the number of variables the user wants to return in Python 3?
Is there some function OutputnNum() that returns the number of variables that the user has specified to the left of the assignment sign when some function F() is run to the right of the assignment sign?
For example, to be able to do this:
def F():
if OutputnNum() == 1:
return 1
elif OutputnNum() == 2:
return 2, 2
a = F()
print(a) #1
a,b = F()
print(a,b) #2 2
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question