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 16,2025.
- Exam Code: PCAP-31-03
- Exam Name: Certified Associate in Python Programming Exam
- Certification Provider: Python Institute
- Latest update: Feb 16,2025
Which of the following statements are true? (Select two answers)
- A . open () is a function which returns an int that represents a physical file handle
- B . the second open () argument is optional
- C . instd, outstd, errstd are the names of pre-opened streams
- D . if invoking open () fails, the value None is returned
What is the expected output of the following snippet?
- A . 1
- B . 4
- C . 2
- D . 3
A variable stored separately in every object is called:
- A . there are no such variables, all variables are shared among objects
- B . a class variable
- C . an object variable
- D . an instance variable
D
Explanation:
Reference: https://dev.to/ogwurujohnson/distinguishing-instance-variables-from-class-variables-in-python-81
Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers.)
- A . a is not None
- B . a ! =b
- C . b () ==4
- D . a () == 4
What is the expected behavior of the following code?
- A . it outputs list assignment index out of range
- B . the code is erroneous and it will not execute
- C . it outputs <class ‘IndexError’>
- D . it outputs error
Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Select two answers)
- A . class Class_4 (D, A) : pass
- B . class Class_1(C,D): pass
- C . class Class_3(A,C): pass
- D . class Class_2(B,D): pass
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 3
- D . it outputs :
What is true about Python packages? (Select two answers)
- A . the__name__variable content determines the way in which the module was run
- B . a package can be stored as a tree of sub-directories/sub-folders
- C . __pycache__is the name of a built-in variable
- D . hashbang is the name of a built-in Python function
What is the expected output of the following code?
- A . abcef
- B . The program will cause a runtime exception error
- C . acdef
- D . abdef
A Python module named pymod, py contains a function named pyfun ( ).
Which of the following snippets will let you invoke the function? (Select two answers)
- A . From pymod import ‘
Pymod.pyfun ( ) - B . Import pymod
Pymod. Pyfun ( ) - C . Import pyfun from pymod
Pyfun ( ) - D . From pymod import pyfun
Pyfun ( )