Exam Code: PCPP1
Exam Questions: 564
Certified Professional in Python Programming 1
Updated: 20 Feb, 2026
Viewing Page : 1 - 57
Practicing : 1 - 5 of 564 Questions
Question 1

As a Python Developer, you need to work with XML files in your application. Suppose you have the following snippet of code:
import xml.etree.ElementTree
 
books = xml.etree.ElementTree.parse('books.xml').getroot()
Which of the following methods can you use to find elements in the xml.etree.EleemntTree module? (select 2)

Options :
Answer: A,C

Question 2

This method is responsible for converting an object's contents into a more or less readable string. You can redefine it if you want your object to be able to present itself in a more elegant form.
The above description applies to the...

Options :
Answer: C

Question 3

Consider the following code snippet:

class BankAccount:

    interest_rate = 0.05

    total_accounts = 0

 

    def __init__(self, account_number, balance):

        self.account_number = account_number

        self.balance = balance

        BankAccount.total_accounts += 1

 def deposit(self, amount):

        self.balance += amount

 

    def withdraw(self, amount):

        if amount <= self.balance:

            self.balance -= amount

        else:

            print("Insufficient funds!")

 @classmethod

    def set_interest_rate(cls, rate):

        cls.interest_rate = rate

 

account1 = BankAccount("123456", 1000)

account2 = BankAccount("987654", 500)

 

account1.deposit(500)

account2.withdraw(200)

 print(account1.balance)

print(account2.balance)

print(BankAccount.interest_rate)

print(BankAccount.total_accounts)

What will be the output of the code snippet?

Options :
Answer: A

Question 4

Suppose you have the following class:

1. class ProductionLine:

2.     def __init__(self, capacity):

3.         self.capacity = capacity

You've created two instances of this class:

1. prod1 = ProductionLine(100)

2. prod2 = ProductionLine(200)

What is the result of the following operation?

Options :
Answer: D

Question 5

1

Options :
Answer: D

Viewing Page : 1 - 57
Practicing : 1 - 5 of 564 Questions

© Copyrights FreePDFQuestions 2026. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (FreePDFQuestions). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the FreePDFQuestions.