0
if I don't use function argument in python means what happens?
2 odpowiedzi
+ 5
Nothing. You dont have to declare a argument in a function. You can write functions without arguments.
def func():
print("i have no parameter")
+ 3
>>> def func(arg):
... print(arg)
...
>>> func()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: func() takes exactly 1 argument (0 given)
>>>
This error is thrown for REQUIRED arguments.