Answer the question
In order to leave comments, you need to log in
How to call the return value of a function?
Goodnight.
Please tell me the reason for the error: "NameError: name 'firstarray' is not defined"
There are such functions:
def getsomething1():
...
return firstarray
def getsomething2():
....
return secondarray
def getsomething3(firstarray, secondarray):
xlist = []
for i in firstarray:
i *= secondarray[0]
x = sin(i)
xlist.append(x)
print(xlist)
getsomething1()
getsomething2()
getsomething3(firstarray, secondarray)
Answer the question
In order to leave comments, you need to log in
you return to void:
firstarray = getsomething1()
secondarray = getsomething2()
getsomething3(firstarray, secondarray)
orgetsomething3(getsomething1(), getsomething2())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question