Python Institute PCED-30-02 Actual Free Exam Questions & Community Discussion
A loop includes a break statement when a condition is met. The programmer wants to understand how break affects loop execution. What happens when break is executed inside the loop?
Correct Answer: A
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Which of the following code snippets will output Truefor both printfunctions by correctly identifying the type of each variable and performing valid operations?
Correct Answer: D
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
You are developing a temperature control module for a laboratory incubator. Your objectives are to:
- generate timestamps every 10 minutes over a 3-hour span (i.e., 0 to 180 minutes), and
- simulate five evenly spaced target temperatures between 35.0°C and 37.0°C for system calibration.
Which code snippet correctly produces both sequences using NumPy? Select the best answer.
import numpy as np
- generate timestamps every 10 minutes over a 3-hour span (i.e., 0 to 180 minutes), and
- simulate five evenly spaced target temperatures between 35.0°C and 37.0°C for system calibration.
Which code snippet correctly produces both sequences using NumPy? Select the best answer.
import numpy as np
Correct Answer: C
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
A program compares two values using == and is. The variables a = 256 and b = 256 are defined.
What is the expected result of a is b in most Python implementations?
What is the expected result of a is b in most Python implementations?
Correct Answer: B
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
A list is defined as [1, 2, 3]. The programmer uses the method .append([4, 5]). What will the resulting list look like after execution?
Correct Answer: D
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
You are writing a function named process_data()to read and process numerical input from a file. The function must:
- read the file data.txt,
- attempt to convert the first line into an integer,
- handle file, conversion, or index-related exceptions,
- print the value only if no error occurs,
- and always print a final message after execution.
Which implementation correctly and robustly meets all these conditions? Select the best answer.
- read the file data.txt,
- attempt to convert the first line into an integer,
- handle file, conversion, or index-related exceptions,
- print the value only if no error occurs,
- and always print a final message after execution.
Which implementation correctly and robustly meets all these conditions? Select the best answer.
Correct Answer: C
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
0
0
0
10
