Summer Sale Limited Time 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = simple75

Pass the Python Institute PCPP1 PCPP-32-101 Questions and answers with Dumpstech

Exam PCPP-32-101 Premium Access

View all detail and faqs for the PCPP-32-101 exam

Practice at least 50% of the questions to maximize your chances of passing.
Viewing page 1 out of 2 pages
Viewing questions 1-10 out of questions
Questions # 1:

Select the true statements related to PEP 8 programming recommendations for exception handling. (Select two answers.)

Options:

A.

When designing exception hierarchies, you should focus on stating that a problem occurred, rather than programmatically trying to answer the question about what actually went wrong.

B.

You should generally use “bare” except: clauses, as they will not catch SystemExit and KeyboardInterrupt exceptions, making it more difficult to interrupt a program using keyboard shortcuts.

C.

You should derive exceptions from the Exception class, rather than from the BaseException class.

D.

You should generally limit the use of a “bare” except: clause and, whenever possible, use specific exceptions instead.

Questions # 2:

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

Question # 2

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 # 3:

Which of the following statements related to :memory: are true?

(Select two answers.)

Options:

A.

:memory: is a special name for loading a database from a file to the RAM.

B.

You can use :memory: to delete a specific database that resides in the RAM.

C.

You can use :memory: to establish a database connection.

D.

:memory: is a special name for creating a temporary database in the RAM.

Questions # 4:

What is a___traceback___?

(Select two answers )

Options:

A.

An attribute owned by every exception object

B.

A special method delivered by the traceback module to retrieve a full list of strings describing the traceback

C.

An attribute that is added to every object when the traceback module is imported

D.

An attribute that holds interesting information that is particularly useful when the programmer wants to store exception details in other objects

Questions # 5:

Which of the following is not a widget property?

Options:

A.

width

B.

underline

C.

highlightthickness

D.

depth

Questions # 6:

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 >

Questions # 7:

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

Question # 7

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 # 8:

Select the true statement about the socket. gaierror exception.

Options:

A.

It is raised when a timeout occurs on a socket.

B.

It is raised when a system function returns a system-related error.

C.

It is raised when an address-related error caused by the repr () function occurs.

D.

It is raised when an address-related error caused by the getaddrinfo () and getnameinfo () functions occurs.

Questions # 9:

What is wrong with the following snippet?

class A:

def run(self):

print("A is running")

class B(A):

def run(self):

print("B is running")

class C(A, B):

def fly(self):

print("C is flying")

c = C()

Options:

A.

There is no run() method defined for the C class.

B.

It causes MRO inconsistency.

C.

Nothing. The code is fine.

D.

There are no __init__() methods — each class should implement this method.

Questions # 10:

Select the true statements about the sqlite3 module. (Select two answers.)

Options:

A.

The fetchalt method returns None when no rows are available

B.

The execute method allows you to perform several queries at once

C.

The execute method is provided by the Cursor class

D.

The fetchone method returns None when no rows are available

Viewing page 1 out of 2 pages
Viewing questions 1-10 out of questions