This is not because of
def
. The
def
part is correct, except one bug: you don't subtract one, because the result of subtraction is lost; you return unchanged
t
.
Should be:
def test(t):
return t - 1
The error is shown due to the previous line, which is simply gibberish; hard to understand how did you want to get
b
. The error on
def
is shown because brackets on the previous line are not balanced.
From the context, one can guess that you wanted to get
b
from user's input. In this case, you should have done:
def test(t):
return t - 1
parameter = input("Input numeric parameter: ")
print test(parameter)
—SA