I have a function and I'm making another one in which I need to call the first function. I don't have experience in Python, but I know that in languages like MATLAB it's possible as long as they're in the same directory.
A basic example:
def square(x):
square = x * x
(and saved)
Now in my new function I want to use the function square I tried:
def something (y, z)
import square
something = square(y) + square(z)
return something
Which displays: builtins.TypeError: 'module' object is not callable
.
What should I do?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…