Is there a way to make arr = [5,4,3,2,1]
while still using both functions and without making arr
global? I need to pass multiple values back from y()
to x(
), but I don't want arr
to = [5,4,3,[2,1]]
. Or do I need to redesign my functions?
arr = [5,4,3]
def x():
arr.append(y())
def y():
a = 2
b = 1
newArr = [a,b]
return newArr
x()
print arr