+ 1
Is def(): a function?????
2 Answers
+ 3
As Jonathan said, the correct syntax for defining a function in python is:
def function_name():
...
A function that sums two terms and returns that sum is:
def my_sum(x, y):
s = x + y
return s
And can be called as:
ex_sum = my_sum(2, 3)
Which of course lets ex_sum be equal to 5.
+ 1
No, because you aren't defining def().
def def(): would be a function.