Python Institute PCEP-30-02 Exam Dumps, Practice Test Questions

100% Latest & Updated Python Institute PCEP-30-02 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!

Python Institute PCEP-30-02  Premium File
$54.99
$49.99

PCEP-30-02 Premium File

  • Premium File: 481 Questions & Answers. Last update: Nov 25, 2026
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates

PCEP-30-02 Premium File

Python Institute PCEP-30-02  Premium File
  • Premium File: 481 Questions & Answers. Last update: Nov 25, 2026
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates
$54.99
$49.99

Python Institute PCEP-30-02 Practice Test 34

Question 330

A developer tests mixed positional and keyword calls. The following code prints '123'. Which explanation best accounts for that observed behavior?def f(a,b,c): return 100*a+10*b+c print(f(1,2,c=3))

  1. An absent list index produces IndexError whereas a missing dictionary key produces KeyError.
  2. A global declaration makes assignment inside the function modify the module-level name.
  3. An inner try-except handles matching exceptions; otherwise an outer compatible handler can receive the propagated error.
  4. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

Explanation

Correct Answer

D:

This is the operative language rule for the code. It directly explains why the example prints '123'; the displayed behavior was independently reproduced by a Python 3 execution check.

Incorrect Answers

A:

The IndexError and KeyError distinct topic does not explain why the code prints '123'. The relevant Python rule is: Positional arguments may precede named arguments, but a single parameter cannot receive two values.

B:

The global declaration changes module binding topic does not explain why the code prints '123'. The relevant Python rule is: Positional arguments may precede named arguments, but a single parameter cannot receive two values.

C:

The nested try except responsibility topic does not explain why the code prints '123'. The relevant Python rule is: Positional arguments may precede named arguments, but a single parameter cannot receive two values.

Question 331

A learner is checking mixed positional and keyword calls. After this modification, what does Python 3 actually do?def f(a,b): return a*b print(f(a=2,3))

  1. Raises KeyError
  2. Raises SyntaxError
  3. Raises TypeError
  4. Raises IndexError

Explanation

Correct Answer

B:

The snippet raises syntaxerror. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

Incorrect Answers

A:

This predicts that the snippet raises keyerror, but executing the displayed Python 3 code raises syntaxerror. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

C:

This predicts that the snippet raises typeerror, but executing the displayed Python 3 code raises syntaxerror. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

D:

This predicts that the snippet raises indexerror, but executing the displayed Python 3 code raises syntaxerror. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

Question 332

During a review of mixed positional and keyword calls, three independent Python 3 fragments are shown. Which TWO statements accurately describe their behavior? (Choose TWO.)Program A: def f(a,b,c): return 100*a+10*b+c print(f(1,2,c=3)) Program B: def f(a,b): return a*b print(f(a=2,3)) Program C: def f(a,b): return a+b print(f(1,a=2))

  1. Program B raises syntaxerror.
  2. Program A prints 'bad'.
  3. Program B prints '[0, 1, 4]'.
  4. Program C raises typeerror.
  5. Program C raises nameerror.

Explanation

Correct Answers

A:

Running Program B raises syntaxerror. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

D:

Running Program C raises typeerror. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

Incorrect Answers

B:

Program A does not produce 'bad'; its verified result is: Prints '123'. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

C:

Program B does not produce '[0, 1, 4]'; its verified result is: Raises SyntaxError. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

E:

Program C does not raises nameerror; its verified result is: Raises TypeError. Positional arguments may precede named arguments, but a single parameter cannot receive two values.

Question 333

A learner is checking default parameter value used when omitted. What is the exact printed result or uncaught exception?def greet(name="guest"): return "hi "+name print(greet())

  1. Prints 'tseug ih'
  2. Prints 'hi gues'
  3. Prints 'hi guest'
  4. Prints 'hi guest?'

Explanation

Correct Answer

C:

The snippet prints 'hi guest'. A default parameter supplies its predeclared value only when the call does not provide that argument.

Incorrect Answers

A:

This predicts that the snippet prints 'tseug ih', but executing the displayed Python 3 code prints 'hi guest'. A default parameter supplies its predeclared value only when the call does not provide that argument.

B:

This predicts that the snippet prints 'hi gues', but executing the displayed Python 3 code prints 'hi guest'. A default parameter supplies its predeclared value only when the call does not provide that argument.

D:

This predicts that the snippet prints 'hi guest?', but executing the displayed Python 3 code prints 'hi guest'. A default parameter supplies its predeclared value only when the call does not provide that argument.

Question 334

A developer tests default parameter value used when omitted. The following code prints '9'. Which explanation best accounts for that observed behavior?def power(x,e=2): return x**e print(power(3))

  1. An except block for an unrelated exception does not intercept the error and execution fails at the uncaught exception.
  2. An inner try-except handles matching exceptions; otherwise an outer compatible handler can receive the propagated error.
  3. A Python function without a reachable return statement returns the singleton None.
  4. A default parameter supplies its predeclared value only when the call does not provide that argument.

Explanation

Correct Answer

D:

This is the operative language rule for the code. It directly explains why the example prints '9'; the displayed behavior was independently reproduced by a Python 3 execution check.

Incorrect Answers

A:

The specific versus incorrect exception catch topic does not explain why the code prints '9'. The relevant Python rule is: A default parameter supplies its predeclared value only when the call does not provide that argument.

B:

The nested try except responsibility topic does not explain why the code prints '9'. The relevant Python rule is: A default parameter supplies its predeclared value only when the call does not provide that argument.

C:

The implicit None return topic does not explain why the code prints '9'. The relevant Python rule is: A default parameter supplies its predeclared value only when the call does not provide that argument.

Question 335

A learner is checking default parameter value used when omitted. After this modification, what does Python 3 actually do?def add(a,b=4): return a+b print(add(5,2))

  1. Prints '7'
  2. Prints '9'
  3. Prints '6'
  4. Prints '8'

Explanation

Correct Answer

A:

The snippet prints '7'. A default parameter supplies its predeclared value only when the call does not provide that argument.

Incorrect Answers

B:

This predicts that the snippet prints '9', but executing the displayed Python 3 code prints '7'. A default parameter supplies its predeclared value only when the call does not provide that argument.

C:

This predicts that the snippet prints '6', but executing the displayed Python 3 code prints '7'. A default parameter supplies its predeclared value only when the call does not provide that argument.

D:

This predicts that the snippet prints '8', but executing the displayed Python 3 code prints '7'. A default parameter supplies its predeclared value only when the call does not provide that argument.

Question 336

During a review of default parameter value used when omitted, three independent Python 3 fragments are shown. Which TWO statements accurately describe their behavior? (Choose TWO.)Program A: def power(x,e=2): return x**e print(power(3)) Program B: def add(a,b=4): return a+b print(add(5,2)) Program C: def f(a=1,b=2): return a*10+b print(f(b=5))

  1. Program A prints '1'.
  2. Program C prints '15'.
  3. Program C prints '24'.
  4. Program B prints '5'.
  5. Program B prints '7'.

Explanation

Correct Answers

B:

Running Program C prints '15'. A default parameter supplies its predeclared value only when the call does not provide that argument.

E:

Running Program B prints '7'. A default parameter supplies its predeclared value only when the call does not provide that argument.

Incorrect Answers

A:

Program A does not produce '1'; its verified result is: Prints '9'. A default parameter supplies its predeclared value only when the call does not provide that argument.

C:

Program C does not produce '24'; its verified result is: Prints '15'. A default parameter supplies its predeclared value only when the call does not provide that argument.

D:

Program B does not produce '5'; its verified result is: Prints '7'. A default parameter supplies its predeclared value only when the call does not provide that argument.

Question 337

A learner is checking keyword can override positional default. What is the exact printed result or uncaught exception?def f(x=2): return x*3 print(f(x=5))

  1. Prints '15'
  2. Prints '16'
  3. Prints '17'
  4. Prints '14'

Explanation

Correct Answer

A:

The snippet prints '15'. A supplied keyword value overrides a default parameter without changing the function definition.

Incorrect Answers

B:

This predicts that the snippet prints '16', but executing the displayed Python 3 code prints '15'. A supplied keyword value overrides a default parameter without changing the function definition.

C:

This predicts that the snippet prints '17', but executing the displayed Python 3 code prints '15'. A supplied keyword value overrides a default parameter without changing the function definition.

D:

This predicts that the snippet prints '14', but executing the displayed Python 3 code prints '15'. A supplied keyword value overrides a default parameter without changing the function definition.

Question 338

A developer tests keyword can override positional default. The following code prints '5'. Which explanation best accounts for that observed behavior?def f(a,b=3): return a-b print(f(9,b=4))

  1. Assigning to a parameter or local variable does not rebind the distinct global name without global.
  2. A supplied keyword value overrides a default parameter without changing the function definition.
  3. The except clause matching the raised exception class handles the error and allows execution to continue.
  4. An uncaught exception raised inside a function propagates to the caller where a matching except can catch it.

Explanation

Correct Answer

B:

This is the operative language rule for the code. It directly explains why the example prints '5'; the displayed behavior was independently reproduced by a Python 3 execution check.

Incorrect Answers

A:

The local name shadows global name topic does not explain why the code prints '5'. The relevant Python rule is: A supplied keyword value overrides a default parameter without changing the function definition.

C:

The exact exception handler selection topic does not explain why the code prints '5'. The relevant Python rule is: A supplied keyword value overrides a default parameter without changing the function definition.

D:

The exceptions propagate across function calls topic does not explain why the code prints '5'. The relevant Python rule is: A supplied keyword value overrides a default parameter without changing the function definition.

Question 339

A learner is checking keyword can override positional default. After this modification, what does Python 3 actually do?def f(x=10,y=1): return x+y print(f(y=7))

  1. Prints '17'
  2. Prints '19'
  3. Prints '16'
  4. Prints '18'

Explanation

Correct Answer

A:

The snippet prints '17'. A supplied keyword value overrides a default parameter without changing the function definition.

Incorrect Answers

B:

This predicts that the snippet prints '19', but executing the displayed Python 3 code prints '17'. A supplied keyword value overrides a default parameter without changing the function definition.

C:

This predicts that the snippet prints '16', but executing the displayed Python 3 code prints '17'. A supplied keyword value overrides a default parameter without changing the function definition.

D:

This predicts that the snippet prints '18', but executing the displayed Python 3 code prints '17'. A supplied keyword value overrides a default parameter without changing the function definition.

Question 340

During a review of keyword can override positional default, three independent Python 3 fragments are shown. Which TWO statements accurately describe their behavior? (Choose TWO.)Program A: def f(a,b=3): return a-b print(f(9,b=4)) Program B: def f(x=10,y=1): return x+y print(f(y=7)) Program C: def f(prefix="x",num=2): return prefix*num print(f(num=3))

  1. Program C prints 'bad'.
  2. Program A prints '7'.
  3. Program C prints 'xxx'.
  4. Program B prints '17'.
  5. Program B prints 'ab'.

Explanation

Correct Answers

C:

Running Program C prints 'xxx'. A supplied keyword value overrides a default parameter without changing the function definition.

D:

Running Program B prints '17'. A supplied keyword value overrides a default parameter without changing the function definition.

Incorrect Answers

A:

Program C does not produce 'bad'; its verified result is: Prints 'xxx'. A supplied keyword value overrides a default parameter without changing the function definition.

B:

Program A does not produce '7'; its verified result is: Prints '5'. A supplied keyword value overrides a default parameter without changing the function definition.

E:

Program B does not produce 'ab'; its verified result is: Prints '17'. A supplied keyword value overrides a default parameter without changing the function definition.

PCEP - Certified Entry-Level Python Programmer (PCEP-30-02) Practice Tests

UP

SPECIAL OFFER: GET 10% OFF

This is ONE TIME OFFER

ExamSnap Discount Offer
Enter Your Email Address to Receive Your 10% Off Discount Code

A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.

Download Free Demo of VCE Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.

Simply submit your e-mail address below to get started with our interactive software demo of your free trial.

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.