Pass the Python Institute PCEP PCEP-30-02 Questions and answers with CertsForce

Viewing page 1 out of 1 pages
Viewing questions 1-10 out of questions
Questions # 1:

How many hashes (+) does the code output to the screen?

Question # 1

Options:

A.

one


B.

zero (the code outputs nothing)


C.

five


D.

three


Expert Solution
Questions # 2:

Which of the following functions can be invoked with two arguments?

A)

Question # 2

B)

Question # 2

C)

Question # 2

D)

Question # 2

Options:

A.

Option A


B.

Option B


C.

Option C


D.

Option D


Expert Solution
Questions # 3:

What is the expected output of the following code?

Question # 3

Options:

A.

The code outputs nothing.


B.

3


C.

1


D.

4


Expert Solution
Questions # 4:

What is the expected result of the following code?

Question # 4

Options:

A.

The code is erroneous and cannot be run.


B.

20


C.

10


D.

30


Expert Solution
Questions # 5:

Arrange the code boxes in the correct positions to form a conditional instruction which guarantees that a certain statement is executed when the speed variable is less than 50.0.

Question # 5


Expert Solution
Questions # 6:

What is the expected result of the following code?

Question # 6

Options:

A.

5


B.

2


C.

1


D.

The code will cause an unhandled


Expert Solution
Questions # 7:

What is true about exceptions and debugging? (Select two answers.)

Options:

A.

A tool that allows you to precisely trace program execution is called a debugger.


B.

If some Python code is executed without errors, this proves that there are no errors in it.


C.

One try-except block may contain more than one except branch.


D.

The default (anonymous) except branch cannot be the last branch in the try-except block.


Expert Solution
Questions # 8:

Assuming that the phonc_dir dictionary contains namemumber pairs, arrange the code boxes to create a valid line of code which retrieves Martin Eden's phone number, and assigns it to the number variable.

Question # 8


Expert Solution
Questions # 9:

Drag and drop the code boxes in order to build a program which prints Unavailable to the screen.

(Note: one code box will not be used.)

Question # 9


Expert Solution
Viewing page 1 out of 1 pages
Viewing questions 1-10 out of questions