Summer Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70track

Free Python Institute PCPP-32-101 Practice Exam with Questions & Answers | Set: 2

Questions 11

What will be the content of the cars.xml file when you run the following code?

import xml.etree.ElementTree as ET

root = ET.Element('data')

car_1 = ET.SubElement(root, 'car', {'brand': 'Audi'})

car_2 = ET.SubElement(root, 'car', {'brand': 'Volkswagen'})

tree = ET.ElementTree(root)

tree.write('cars.xml', 'UTF-8', True)

Options:
A.

< data > < car brand="Audi" / > < car brand="Volkswagen" / > < /data >

B.

< ?xml version='1.0'? >

< data > < car brand="Audi" / > < car brand="Volkswagen" / > < /data >

C.

< ?xml version='1.0' encoding='UTF-8'? >

< data > < car brand="Audi" / > < car brand="Volkswagen" / > < /data >

D.

< ?xml? >

< data > < car brand="Audi" / > < car brand="Volkswagen" / > < /data >

Python Institute PCPP-32-101 Premium Access
Questions 12

Select the true statement about PEP 8 recommendations related to line breaks and binary operators.

Options:
A.

It is recommended that you use line breaks before binary operators to improve code readability.

B.

It is permissible to use line breaks before or after a binary operator as long as the convention is consistent locally However, for new code it is recommended that break lines should be used only after binary operators.

C.

It is recommended that you use line breaks after binary operators to improve code readability.

D.

There is no specific PEP 8 recommendation related to using line breaks with binary operators.

Questions 13

Select the true statements about the following invocation:

PCPP-32-101 Question 13

(Select two answers.)

Options:
A.

It addresses a service deployed at localhost (the host where the code is run).

B.

It addresses a service whose timeout is set to 3000 ms.

C.

It addresses a service located at the following address local.host.com.

D.

It addresses a service listening at port 3000.

Questions 14

What is true about a parameter named cls?

Options:
A.

It is usually used as a reference to a class instance.

B.

It is usually used as the first parameter of a static method.

C.

It is usually used as the first parameter of a class method.

D.

It is the name of a module that delivers an abstract method decorator.

Questions 15

Analyze the following snippet and choose the best statement that describes it.

class Sword:

var1 = 'weapon'

def __init__(self):

self.name = 'Excalibur'

s1 = Sword()

Options:
A.

The snippet will cause an AttributeError exception.

B.

The snippet will cause a ValueError exception.

C.

The class variable value can be updated with the following code: cls.var1

D.

The class variable value can be updated with the following code: Sword.var1

Questions 16

A socket object is usually created by which one of the following invocations?

Options:
A.

socket. socket (socket_domain, socket_type)

B.

socket = socket. socket (socket_number)

C.

socket = socket. socket (socket_domain, socket_type, server_address)

D.

socket = socket.socket(server address)

Questions 17

Which function or operator should you use to obtain the answer True or False to the question: "Do two variables refer to the same object?"

Options:
A.

The = operator

B.

The isinstanceO function

C.

The id () function

D.

The is operator

Questions 18

Analyze the code and choose the best statement that describes it.

PCPP-32-101 Question 18

Options:
A.

___ne___() is not a built-in special method

B.

The code is erroneous

C.

The code is responsible for the support of the negation operator e.g. a = - a.

D.

The code is responsible for the support of the inequality operator i.e. i =

Questions 19

Analyze the following snippet and select the statement that best describes it.

PCPP-32-101 Question 19

Options:
A.

The code is an example of implicitly chained exceptions.

B.

The code is erroneous as the OwnMath class does not inherit from any Exception type class

C.

The code is fine and the script execution is not interrupted by any exception.

D.

The code is an example of explicitly chained exceptions.

Questions 20

What is true about the unbind () method? (Select two answers.)

Options:
A.

It is invoked from within the events object

B.

It is invoked from within a widget's object

C.

It needs a widget's object as an argument

D.

It needs the event name as an argument

Exam Code: PCPP-32-101
Certification Provider: Python Institute
Exam Name: PCPP1 – Certified Professional in Python Programming 1
Last Update: Jul 6, 2026
Questions: 69
PDF + Testing Engine
$164.99
$49.5
Testing Engine
$124.99
$37.5
PDF (Q&A)
$104.99
$31.5

Python Institute Free Exams

Python Institute Free Exams
Examstrack offers free Python Institute exam materials and practice tests to aid your Python Institute certification journey.