KnowledgeBoat Logo

Computer Science

Which of the following statements is not true for parameter passing to functions ?

  1. You can pass positional arguments in any order.
  2. You can pass keyword arguments in any order.
  3. You can call a function with positional and keyword arguments.
  4. Positional arguments must be before keyword arguments in a function call.

Python Functions

2 Likes

Answer

You can pass positional arguments in any order.

Reason — Positional arguments are passed to a function based on their positions in the function call statement. The first positional argument in the function call is assigned to the first parameter in the function definition, the second positional argument is assigned to the second parameter, and so on.

Answered By

2 Likes


Related Questions