0

import xyz;add=xyz.a(u,v);return u+v; print(add(5,4)) getting unintended error? Define the functions using the modulename

23rd May 2017, 1:25 PM
sai charan tej
sai charan tej - avatar
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))
23rd May 2017, 5:09 PM
OrbitHv [Inactive]
OrbitHv [Inactive] - avatar
+ 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'??
23rd May 2017, 5:16 PM
OrbitHv [Inactive]
OrbitHv [Inactive] - avatar
23rd May 2017, 5:15 PM
sai charan tej
sai charan tej - avatar
0
Got the same error @Orb_H
23rd May 2017, 5:16 PM
sai charan tej
sai charan tej - avatar