0
Please tell me what is wrong in this code?
https://code.sololearn.com/c2gRA65F2LLq/?ref=app https://code.sololearn.com/cZ7A4b8xf8bE/?ref=app
6 odpowiedzi
+ 1
Did you save the file in same folder?
refer this
https://stackoverflow.com/questions/20309456/call-a-function-from-another-file-in-JUMP_LINK__&&__python__&&__JUMP_LINK
+ 3
Can you say what you are trying to do in second code?
In the first code,you missed the colon at the end of function definition. Indentation is very important in python. Every statement inside the function should be indented unless it will not belong to the function.
def evenodd():
a=int(input("enter a value\n"))
if(a%2==0):
print("even number")
else:
print("odd number")
evenodd()
+ 1
In the second code, you are trying to import a module that doesnt exist (maths.py does not exist in the directory or in your path).
This is because sololearn doesnt save these files in the same way your computer does. importing your own code in sololearn is a lot more complicated than it is on your own computer.
there is no actual flaw in that code, it just isnt compatible with how sololearn is set up.
0
In the second code i am trying to import the first code.
Now please see again .
Error is still coming.
0
In my computer also error is coming
0
Ok,
Thank u
Now it's working