Exclusive Black Friday Deal: 70% Off All Exam Bundles! Use coupon code below to unlock your savings! - Ends in 0d 00h 00m 00s - Coupon code: Friday70

Free Certified Associate in Python Programming Practice Questions

Question # 21

If you need a function that does nothing, what would you use instead of XXX? (Select two answers)

def idler ( ):

XXX

Options:

A.  

pass

B.  

return

C.  

exit

D.  

None

Discussion 0
Question # 22

What is the expected behavior of the following code?

Question # 22

Options:

A.  

It outputs 2

B.  

It outputs 0.

C.  

It outputs 1.

D.  

It raises an exception

Discussion 0
Question # 23

What is the expected behavior of the following code?

Question # 23

Options:

A.  

the code is erroneous and it will not execute

B.  

it outputs 'tuple' object does not support item assignment

C.  

0it outputs list assignment index out of range

D.  

it outputs None

Discussion 0
Question # 24

What is the expected output of the following code?

Question # 24

Options:

A.  

4

B.  

16

C.  

an exception is raised

D.  

1

Discussion 0
Question # 25

What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?

Question # 25

Options:

A.  

the length of the first line from the file

B.  

-1

C.  

the number of lines contained inside the file

D.  

the length of the last line from the file

Discussion 0
Question # 26

What is the expected output of the following code?

Question # 26

Options:

A.  

a

B.  

an exception is raised

C.  

b

D.  

c

Discussion 0
Question # 27

Which of the following invocations are valid? (Select two answers)

Options:

A.  

rfind("python","r")

B.  

sorted("python")

C.  

"python".sort ()

D.  

"python".index("th")

Discussion 0
Question # 28

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

Question # 28

Options:

A.  

BB

B.  

CC

C.  

AA

D.  

BC

Discussion 0
Question # 29

What is the expected behavior of the following snippet?

Question # 29

It will:

Options:

A.  

cause a runtime exception

B.  

print 1

C.  

print 0 , [1]

D.  

print [1J

Discussion 0
Question # 30

The__bases__property contains:

Options:

A.  

base class locations (addr)

B.  

base class objects (class)

C.  

base class names (str)

D.  

base class ids (int)

Discussion 0

PCAP-31-03 PDF

PCAP-31-03 PDF (Printable)
$46.5
$154.99

PCAP-31-03 Testing Engine

PCAP-31-03 PDF (Printable)
$51
$169.99

PCAP-31-03 PDF + Testing Engine

PCAP-31-03 PDF (Printable)
$63.9
$212.99

Free Exams Sample Questions