Summer Certification Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

Free and Premium Python Institute PCPP-32-101 Dumps Questions Answers

Page: 1 / 5
Total 69 questions

PCPP1 – Certified Professional in Python Programming 1 Questions and Answers

Question 1

Select the correct statements about the csv module.

(Select two answers.)

Options:

A.

The DictReader method always gets the header from the first line in the file.

B.

A reader object maps each row to a list of strings.

C.

It is possible to create a DictWriter object without specifying a header.

D.

A DictReader object maps each row to a dict.

Buy Now
Question 2

What will be the content of the co/ors.csv file when you run the following code?

A)

B)

C)

D)

An exception will be raised.

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 3

What is true about the constructor’s argument, which sets the button’s title to a desired string?

Options:

A.

It is the second argument of the constructor.

B.

It is the third argument of the constructor.

C.

It is a keyword argument named title.

D.

It is a keyword argument named text.

Question 4

To get an answer (True or False) to the question of whether two objects hold the same values, you should use:

Options:

A.

The id() function

B.

The isinstance() function

C.

The == operator

D.

The is operator

Question 5

Select the true statements about PEP 8 recommendations related to using blank lines. (Select two answers.)

Options:

A.

You should not put any blank lines between groups of imports.

B.

You should surround top-level functions and class definitions with one blank line.

C.

You should surround top-level functions and class definitions with two blank lines.

D.

You should surround method definitions inside classes by a single blank line.

Question 6

In the JSON processing context, the term serialization:

Options:

A.

names a process in which Python data is turned into a JSON string.

B.

names a process in which a JSON string is turned into Python data.

C.

refers to nothing, because there is no such thing as JSON serialization.

D.

names a process in which a JSON string is remodeled and transformed into a new JSON string

Question 7

Select the true statements about the connection-oriented and connectionless types of communication. (Select two answers.)

Options:

A.

In the context of TCP/IP networks, the communication side that initiates a connection is called the client, whereas the side that answers the client is called the server

B.

Connectionless communications are usually built on top of TCP

C.

Using walkie-talkies is an example of a connection-oriented communication

D.

A phone call is an example of a connection-oriented communication

Question 8

Select the true statements related to PEP 8 naming conventions. (Select two answers.)

Options:

A.

Class names should use the mixedCase naming style.

B.

Exception names should follow the function naming conventions.

C.

Modules should have short names entirely in lower-case.

D.

You should never use the characters “l” (lower-case letter “el”) and “O” (upper-case letter “oh”) as single character variable names.

Question 9

Look at the following code snippets and decide which ones follow PEP 8 recommendations for whitespaces in expressions and statements (Select two answers.)

A)

No whitespace immediately before the opening parenthesis that starts the list of arguments of a function call:

B)

A whitespace immediately before a comma, semicolon, and colon:

C)

No whitespace between a trailing comma and a following closing parenthesis:

D)

A whitespace immediately after the opening parenthesis that starts indexing or slicing:

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 10

What is the result of the following code?

import configparser

config = configparser.ConfigParser()

config['DEFAULT'] = {}

config['mysql'] = {}

config['postgresql'] = {}

config['redis'] = config['postgresql']

print(config.sections())

Options:

A.

['DEFAULT', 'mysql', 'postgresql', 'redis']

B.

['mysql', 'postgresql', 'redis']

C.

['DEFAULT', 'mysql', 'postgresql', 'postgresql']

D.

['mysql', 'postgresql', 'postgresql']

Question 11

The following snippet represents one of the OOP pillars Which one is that?

Options:

A.

Serialization

B.

Inheritance

C.

Encapsulation

D.

Polymorphism

Question 12

What is true about the unbind_all () method?

(Select two answers.)

Options:

A.

It can be invoked from any widget

B.

It can be invoked from the main window widget only

C.

It is parameterless

D.

It causes all the widgets to disappear

Question 13

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

Question 14

Select the true statements related to PEP 8 naming conventions. (Select two answers.)

Options:

A.

Function and variable names should be lower-case with words separated by underscores.

B.

You should always use self as the first argument to instance methods, and cls as the first argument to class methods.

C.

Modules should have short names written in CameICase.

D.

Constants should be written in all lower-case letters with words separated by underscores

Question 15

Select the true statements about sockets. (Select two answers)

Options:

A.

A socket is a connection point that enables a two-way communication between programs running in a network.

B.

A socket is always the secure means by which computers on a network can safely communicate, without the risk of exposure to an attack

C.

A socket is a connection point that enables a one-way communication only between remote processes

D.

A socket can be used to establish a communication endpoint for processes running on the same or different machines.

Question 16

Select the true statements about the json.-dumps () function. (Select two answers.)

Options:

A.

It returns a JSON string.

B.

It returns a Python entity.

C.

It takes a JSON string as its argument

D.

It takes Python data as its argument.

Question 17

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

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.

Question 18

Which sentence about the ©property decorator is false?

Options:

A.

The ©property decorator should be defined after the method that is responsible for setting an encapsulated attribute.

B.

The @property decorator designates a method which is responsible for returning an attribute value

C.

The ©property decorator marks the method whose name will be used as the name of the instance attribute

D.

The ©property decorator should be defined before the methods that are responsible for setting and deleting an encapsulated attribute

Question 19

What will happen if the mam window is too small to fit all its widgets?

Options:

A.

Some widgets may be invisible

B.

The window will be expanded.

C.

An exception will be raised.

D.

The widgets will be scaled down to fit the window's size.

Question 20

Which methods can be invoked in order to draw a triangle?

(Select two answers.)

Options:

A.

create_shape()

B.

create_line()

C.

create_triangle_shape()

D.

create_polygon()

Page: 1 / 5
Total 69 questions