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 18,2025.
- Exam Code: PCAP-31-03
- Exam Name: Certified Associate in Python Programming Exam
- Certification Provider: Python Institute
- Latest update: Feb 18,2025
You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been created before)
- A . dir={‘Mom’:5551234567, ‘Dad’:5557654321>
- B . dir={‘Mom’:’5551234567′, * Dad’:’5557654321′}
- C . dir={Mom:5551234567, Dad:5557654321}
- D . dir={Mom:’5551234567′, Dad:’5557654321′}
Which of the following invocations are valid? (Select two answers)
- A . sorted ("python”)
- B . "python" .sort ( )
- C . sort" ("python")
- D . "python’ ,find (")
What is the expected behavior of the following code?
- A . it outputs 1
- B . it outputs 0
- C . it raises an exception
- D . it outputs 2
What is the expected output of the following code if there is no file named non existing_file inside the working directory?
- A . 2 2
- B . 1 3
- C . 1 2 3
- D . 2 2 3
What will the value of the i variable be when the following loop finishes its execution?
- A . 10
- B . the variable becomes unavailable
- C . 11
- D . 9
D
Explanation:
Pass only means there are no statements to execute it does not means the variable is unavailable. Try a Print statement Print(i) after the For Loop and there is your result.
Assuming that the math module has been successfully imported, which of the following expressions evaluate to True? (Select two answers)
- A . math. hypot (3,4) == math.sqrt (25)
- B . math. hypot (2,5) == math.truec (2.5)
- C . math. hypot (2,5) == math.true (2.5)
- D . math. cell (2,5) == math.floor (2.5)
What is a true about python class constructors? (Select two answers)
- A . the constructor must have at least one parameter
- B . the constructor must return a value other than None
- C . the constructor is a method named_init_
- D . there can the more than one constructor in a Python class.
Assuming that the code below has been executed successfully, which of the following expressions evaluate to True? (Select two answers)
- A . ‘var’ in Object.__dict__
- B . ‘prop’ in Class.__dict
- C . len(Object.__diet__) == 1
- D . ‘var1 in Class, dict
Which of the following expressions evaluate to True? (Select two answers)
- A . str(1-1) in ‘012345£739′[:2]
- B . ‘phd’ in ‘alpha’
- C . ‘deb’ not in ‘abcde’ [::-1]
- D . ‘True’ not in ‘False’
What will be the value of the i variable when the while e loop finishes its execution?
- A . 1
- B . 0
- C . 2
- D . the variable becomes unavailable