PCEP-30 Expressions Practice Questions
The free PCEP-30-02: PCEP – Certified Entry-Level Python Programmer questions that deal with expressions, with answers and explanations. The full bank and the timed practice test cover every topic the exam asks about.
Question #6
Which of the following expressions evaluate to a non-zero result? (Select two answers.)
Select 2 answers.
Correct answer: B, C
Explanation
** binds tightest, then / and //. A: 8 / 4 - 2 = 0.0. B: 4 / 8 - 2 = -1.5. C: 1 / 4 - 1 = -0.75. D: 4 // 8 = 0. Only B and C are non-zero.
Question #10
Assuming that the following assignment has been successfully executed: my_list = [1, 1, 2, 3] Select the expressions which will not raise any exception. (Select two expressions.)
Select 2 answers.
Correct answer: B, D
Explanation
my_list[-10] and my_list[6] are out of range and raise IndexError. my_list[my_list[3]] evaluates to my_list[3], which is 3, and my_list[0:1] is a slice; slices never raise even when out of range.
Continue with PCEP-30-02: PCEP – Certified Entry-Level Python Programmer
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCEP-30-02: PCEP – Certified Entry-Level Python Programmer, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
All PCEP-30-02: PCEP – Certified Entry-Level Python Programmer practice questions →
