def ten(x):
x=10
return x
print ten(3)
output:
File "<ipython-input-1-9fb8d4762a52>", line 4 print ten(3) ^ SyntaxError: invalid syntax
After restarting the kernel, result is same the syntax error is occurred. Please help me out of this.
def ten(x):
x=10
return x
print ten(3)
OUTPUT:
File "<ipython-input-1-9fb8d4762a52>", line 4 print ten(3) ^ SyntaxError: invalid syntax
Please add indentation before print statement. It will work .:)
Your code:-
def ten(x):
x=10
return x
print ten(3) [This statement should be indented]
Correct code:-
def ten(x):
x=10
return x
print ten(3) [Indented properly]
hope it helps!
Have a good day!:) 🙂
it is same.
def ten(x):
x=10
return x
print ten(3)
File “”, line 5
print ten(3)
^
SyntaxError: invalid syntax