New Year Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

Python Institute PCAP-31-03 - Certified Associate in Python Programming

Page: 2 / 5
Total 154 questions

With regards to the directory structure below, select the proper forms of the directives in order to import module_a. (Select two answers)

A.

import pypack.module_a

B.

import module_a from pypack

C.

import module_a

D.

from pypack import module_a

A compiler is a program designed to (select two answers)

A.

rearrange the source code to make it clearer

B.

check the source code in order to see if its correct

C.

execute the source code

D.

translate the source code into machine code

What is the expected behavior of the following code?

It will

A.

print 2 1

B.

print 1 2

C.

cause a runtime exception

D.

print

What is the expected behavior of the following code?

A.

It outputs False

B.

It outputs nothing

C.

It outputs True

D.

It raises an exception

The__bases__property contains:

A.

base class locations (addr)

B.

base class objects (class)

C.

base class names (str)

D.

base class ids (int)

The following class hierarchy is given. What is the expected output of the code?

A.

BB

B.

CC

C.

AA

D.

BC

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 one of the platform module functions should be used to determine the underlying platform name?

A.

platform.uname ()

B.

platform.platform ()

C.

platform.python_version()

D.

platform.processor()

You are going to read just one character from a stream called s. Which statement would you use?

A.

ch = read(s, 1)

B.

ch = s. input(1)

C.

ch = input(s, 1)

D.

ch = s. read(l)

What is the expected behavior of the following code?

It will:

A.

print 4321

B.

print

C.

cause a runtime exception

D.

print 1234