How do I get both values while compiling? It is only returning 129.
def nestedListSum(NL):
if isinstance(NL, int):
return NL
o=NL*2
return o
# some examples
print(nestedListSum(129))
How do I get both values while compiling? It is only returning 129.
def nestedListSum(NL):
if isinstance(NL, int):
return NL
o=NL*2
return o
# some examples
print(nestedListSum(129))
Put all values that you want to return in a single return
statement:
def nestedListSum(NL):
if isinstance(NL, int):
o = NL * 2
return NL, o
print(nestedListSum(129))
This returns a tuple (129, 258)
.