Certbus > Python Institute > PCAP > PCAP > PCAP Online Practice Questions and Answers

PCAP Online Practice Questions and Answers

Questions 4

What will the value of the i variable be when the following loop finishes its execution?

A. 10

B. the variable becomes unavailable

C. 11

D. 9

Browse 153 Q&As
Questions 5

Which of the following literals reflect the value given as 34.23? (Select two answers)

A. .3423e2

B. 3423e-2

C. .3423e-2

D. 3423e2

Browse 153 Q&As
Questions 6

What is the expected output of the following snippet?

A. 1

B. 4

C. 2

D. 3

Browse 153 Q&As
Questions 7

A keyword (Select two answers)

A. can be used as an identifier

B. is defined by Python's lexis

C. is also known as a reserved word

D. cannot be used in the user's code

Browse 153 Q&As
Questions 8

Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Select two answers)

Expected output: 1 2 3

Code:

A. c, b, a = b, a, c

B. c, b, a = a, c, b

C. a, b, c = c, a, b

D. a, b, c = a, b, c

Browse 153 Q&As
Questions 9

How many stars (*) does the following snippet print?

A. the code is erroneous

B. five

C. three

D. four

Browse 153 Q&As
Questions 10

Which of the listed actions can be applied to the following tuple? (Select two answers)

A. tup [:]

B. tup.append (0)

C. tup [0]

D. del tup

Browse 153 Q&As
Questions 11

Assuming that 1st is a four-element list is there any difference between these two statements?

A. yes, there is, the first line empties the list, the second line deletes the list as a whole

B. yes, there is, the first line deletes the list as a whole, the second line just empties the list

C. no, there is no difference

D. yes, there is, the first line deletes the list as a whole, the second line removes all the elements except the first one

Browse 153 Q&As
Questions 12

The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead of XXX?

A. print (get(self))

B. print (self.get())

C. print (get())

D. print (self.get (val))

Browse 153 Q&As
Questions 13

What is the expected behavior of the following code?

A. it raises an exception

B. it outputs True

C. it outputs False

D. it outputs nothing

Browse 153 Q&As
Questions 14

What is true about Python class constructors? (Choose two.)

A. there can be more than one constructor in a Python class

B. the constructor must return a value other than None

C. the constructor is a method named __init__

D. the constructor must have at least one parameter

Browse 153 Q&As
Questions 15

What is the expected output of the following code if there is no file named non_existing_file inside the working directory?

A. 1 2 4

B. 1 2 3 4

C. 2 4

D. 1 3

Browse 153 Q&As
Questions 16

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

A. b() == 4

B. a != b

C. a is not None

D. a() == 4

Browse 153 Q&As
Questions 17

What is the expected behavior of the following code?

A. it raises an exception

B. it outputs nothing

C. it outputs True

D. it outputs False

Browse 153 Q&As
Questions 18

Which of the following expressions evaluate to True? (Choose two.)

A. `in' in `Thames'

B. `in' in `in'

C. `in not' in `not'

D. `t'.upper() in `Thames'

Browse 153 Q&As
Exam Code: PCAP
Exam Name: Certified Associate in Python Programming
Last Update: Apr 30, 2024
Questions: 153 Q&As

PDF

$45.99

VCE

$49.99

PDF + VCE

$59.99