PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 62


A method for passing the arguments used by the following snippet is called:

Show Answer
Correct Answer: C

In the provided code snippet, the arguments for the function 'fun' are passed by their position in the argument list (1 for 'a' and 2 for 'b'). This method of passing arguments is referred to as positional argument passing. Therefore, the correct answer is 'positional'.

Discussion

7 comments
Sign in to comment
AvidulamOption: C
Mar 12, 2020

Thee answer is C, its positional.

RajdeepOption: C
Mar 22, 2020

Its C- Positional

SpectraOption: C
Sep 3, 2020

Its positional

macxszOption: C
May 3, 2022

C. positional

ekossovOption: C
Dec 2, 2022

The answer is correct. it is positional

SheilaMOption: C
Mar 7, 2023

C , it’s positional

seaverickOption: C
Feb 4, 2024

https://builtin.com/software-engineering-perspectives/arguments-in-python Keyword arguments should follow positional arguments only. def add(a,b,c): return (a+b+c) The above function can be called in two ways: First, during the function call, all arguments are given as positional arguments. Values passed through arguments are passed to parameters by their position. 10 is assigned to a, 20 is assigned to b and 30 is assigned to c. print (add(10,20,30)) #Output:60 The second way is by giving a mix of positional and keyword arguments. Keyword arguments should always follow positional arguments. print (add(10,c=30,b=20)) #Output:60