Python Institute Certified Associate in Python Programming PCAP-31-03 Exam Practice Test

Page: 1 / 14
Total 144 questions
Question 1

What is the expected behavior of the following code?

x - 3 % 1

y -1 if x > else 0

print (y)



Answer : D


Question 2

Assuming that the code below has been executed successfully, which of the following expressions will always evaluate to True? (Select two answers)

import random

v1 = random. random()

v2 = random. random()



Answer : B, C


Question 3

What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?



Answer : A


Question 4

Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Select two answers)

string = 'python' [::2]

string = string[-1] + string[-2]



Answer : B, C


Question 5

Which of the following expression evaluate to True? (Select two answers)



Answer : C, D


Question 6

Assuming that the following snippet has been successfully executed, which of the equations are True? (Select two answers)



Answer : B, D


Question 7

Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers)



Answer : C, D


Page:    1 / 14   
Total 144 questions