Python Institute PCAP-31-03 Certified Associate in Python Programming Exam Online Training
Python Institute PCAP-31-03 Online Training
The questions for PCAP-31-03 were last updated at Feb 13,2025.
- Exam Code: PCAP-31-03
- Exam Name: Certified Associate in Python Programming Exam
- Certification Provider: Python Institute
- Latest update: Feb 13,2025
If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:
- A . except Ex1 Ex2:
- B . except (ex1, Ex2):
- C . except Ex1, Ex2:
- D . except Ex1+Ex2:
What is the expected behavior of the following code?
It will:
- A . print 0
- B . cause a runtime exception
- C . prints 3
- D . print an empty line
Which of the following expression evaluate to True? (Select two answers)
A)
B)
C)
D)
- A . Option A
- B . Option B
- C . Option C
- D . Option D
What can you deduce from the following statement? (Select two answers)
str = open(‘file.txt’, "rt")
- A . str is a string read in from the file named file.txt
- B . a newlina character translation will be performed during the reads
- C . if file. txt does not exist, it will be created
- D . the opened file cannot be written with the use of the str variable
What is the expected behavior of the following code?
- A . it raises an exception
- B . it outputs True
- C . it outputs False
- D . it outputs nothing
What is the expected behavior of the following code?
- A . it outputs ‘None’
- B . it outputs 3
- C . it raises an exception
- D . it outputs 0
What is the expected behavior of the following code?
- A . it outputs [1, 3]
- B . the code is erroneous and it will not execute
- C . it outputs [3, 1]
- D . it outputs [4, 2, 0]
What is the expected behavior of the following code?
- A . it outputs 2
- B . the code is erroneous and it will not execute
- C . it outputs 1
- D . it outputs 3
What is the expected output of the following snippet?
- A . 3
- B . 1
- C . 2
- D . the code is erroneous
Assuming that the following code has been executed successfully, selected the expression which evaluate to True (Select two answers)
- A . a ( ) == 4
- B . a is not None
- C . b ( ) == 4
- D . a ! = b