0
import xyz;add=xyz.a(u,v);return u+v; print(add(5,4)) getting unintended error? Define the functions using the modulename
4 Antworten
+ 1
The second line:
add = xyz.a(u, v)
should be
add = xyz.a
When using a variable as a function, you should write only the name of the function, not the parameters. And third line may be deleted because there are no such variables named 'u' or 'v'...
So the result:
import xyz
add = xyz.a
print(add(5, 4))
+ 1
That is caused because there is no such module named 'xyz'...
+EDIT+
I thought you made xyz.py and defined function named 'add' in the file and tried to import it.. Were you just trying to import module 'xyz'??
0
Got the same error @Orb_H