Practice Free PCEP-30-02 Exam Online Questions
Question #101
What is the decimal value of the following binary number?
1010
- A . 8
- B . 4
- C . 12
- D . 10
Correct Answer: D
Question #102
Which of the following expressions evaluate to zero? (Choose two.)
- A . 2//4*1/3
- B . 4/1*2-1
- C . 1 * 2 / 4 * 3
- D . -1/3*3+1
Correct Answer: AD
Question #103
What is the output of the following snippet?

- A . [1, 2, 3]
- B . [3, 3, 3]
- C . [3, 2, 1]
- D . [1, 1, 1]
Correct Answer: C
Question #104
The expression:
‘mike’ > ‘Mike’
is
- A . erroneous
- B . true
- C . false
Correct Answer: B
Question #105
What is the expected output of the following code?

- A . None
- B . 1
- C . 2
- D . The code is erroneous.
Correct Answer: D
Question #106
Consider the following code.

Why is it not working?
- A . Misnamed variable(s)
- B . Mismatched data type(s)
- C . Invalid Syntax
- D . None of the above.
Correct Answer: B
Question #107
What is the expected output of the following code?

- A . 1 | False
2 | True
3 | False
4 | True - B . 1 | False
2 | True
3 | True
4 | True - C . 1 | False
2 | True
3 | True
4 | False - D . 1 | False
2 | False
3 | True
4 | True
Correct Answer: B
Question #108
Which of the literals below is not a valid function name?
- A . Function_1
- B . Function1
- C . _function1
- D . 1function
- E . Func_1_tion
Correct Answer: D
Question #109
What is the expected output of the following code?

- A . 1
- B . The code raises an unhandled exception.
- C . False
- D . (‘Fermi ‘, ‘2021’, ‘False’)
Correct Answer: D
D
Explanation:
The code snippet that you have sent is defining and calling a function in Python.
The code is as follows:
def runner (brand, model, year): return (brand, model, year)
print(runner(“Fermi”))
The code starts with defining a function called “runner” with three parameters: “brand”, “model”, and “year”. The function returns a tuple with the values of the parameters. A tuple is a data type in Python that can store multiple values in an ordered and immutable way. A tuple is created by using parentheses and separating the values with commas. For example, (1, 2, 3) is a tuple with three values.
Then, the code calls the function “runner” with the value “Fermi” for the “brand” parameter and prints the result. However, the function expects three arguments, but only one is given. This will cause a Type Error exception, which is an error that occurs when a function or operation receives an argument that has the wrong type or number. The code does not handle the exception, and therefore it will terminate with an error message.
However, if the code had handled the exception, or if the function had used default values for the missing parameters, the expected output of the code would be (‘Fermi ‘, ‘2021’, ‘False’). This is because the function returns a tuple with the values of the parameters, and the print function displays the tuple to the screen. Therefore, the correct answer is D. (‘Fermi ‘, ‘2021’, ‘False’).
Reference: Python Functions – W3SchoolsPython Tuples – W3SchoolsPython Exceptions: An Introduction C Real Python
D
Explanation:
The code snippet that you have sent is defining and calling a function in Python.
The code is as follows:
def runner (brand, model, year): return (brand, model, year)
print(runner(“Fermi”))
The code starts with defining a function called “runner” with three parameters: “brand”, “model”, and “year”. The function returns a tuple with the values of the parameters. A tuple is a data type in Python that can store multiple values in an ordered and immutable way. A tuple is created by using parentheses and separating the values with commas. For example, (1, 2, 3) is a tuple with three values.
Then, the code calls the function “runner” with the value “Fermi” for the “brand” parameter and prints the result. However, the function expects three arguments, but only one is given. This will cause a Type Error exception, which is an error that occurs when a function or operation receives an argument that has the wrong type or number. The code does not handle the exception, and therefore it will terminate with an error message.
However, if the code had handled the exception, or if the function had used default values for the missing parameters, the expected output of the code would be (‘Fermi ‘, ‘2021’, ‘False’). This is because the function returns a tuple with the values of the parameters, and the print function displays the tuple to the screen. Therefore, the correct answer is D. (‘Fermi ‘, ‘2021’, ‘False’).
Reference: Python Functions – W3SchoolsPython Tuples – W3SchoolsPython Exceptions: An Introduction C Real Python
Question #110
What is the expected output of the following code?

- A . 4
- B . 10
- C . Nothing gets printed.
- D . The code is erroneous.
Correct Answer: B
