asked 136k views
3 votes
Which of the following lines properly starts a function using two parameters, both with zeroed default values?

1) fun fun(a=0,b)
2) fun fun(a,b=0)
3) def fun(a=0,b=0)
4)ef fun(a=b=0)

asked
User Saca
by
8.8k points

1 Answer

7 votes

Final answer:

The correct format for starting a function with two parameters that both have default values of zero in Python is def fun(a=0,b=0). This uses the 'def' keyword, the function name, and parentheses with parameters and their default values.

Step-by-step explanation:

The correct way to start a function using two parameters, both with zeroed default values in Python, is option 3: def fun(a=0,b=0). When defining a function, the keyword def is used, followed by the function name and parentheses containing the parameters and their default values. Having default values for parameters means that the function can be called without passing arguments for those parameters, and the default value will be used instead.

answered
User Takim
by
8.1k points