2nd Jan 2020, 5:00 PM
abhinendra singh
6 odpowiedzi
+ 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()
2nd Jan 2020, 5:04 PM
Geek
Geek - avatar
+ 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.
4th Jan 2020, 5:49 AM
Steven Jacobsen
Steven Jacobsen - avatar
0
In the second code i am trying to import the first code. Now please see again . Error is still coming.
2nd Jan 2020, 5:16 PM
abhinendra singh
0
In my computer also error is coming
4th Jan 2020, 6:25 AM
abhinendra singh
0
Ok, Thank u Now it's working
4th Jan 2020, 7:45 AM
abhinendra singh