Free Demo Questions

Test Online Free Python Institute PCAP-31-03 Exam Questions and Answers

Practice a live sample before buying full access. This page keeps the free PCAP-31-03 question set organized by page so visitors and search engines can reach the canonical -questions.html URL directly.

Updated Aug 15, 2022 30 Questions 2 Pages
Page 1 of 2
Next Page
Question 1 Selectable Answer
What is the expected output of the following snippet?


Answer:
Question 2 Selectable Answer
Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)


Answer:
Explanation:
>>> print(len(a)==len(b)) True
>>> print(a[0]-1==b[0]) True
>>> print(a[0]==b[0]) False
>>> print(b[0]-1 == a[0]) False
Question 3 Selectable Answer
Assuming that String is six or more letters long, the following slice
String[1:-2]
is shorter than the original string by:

Answer:
Question 4 Selectable Answer
Select the valid fun () invocations:
(select two answers)
def fun (a, b=0):
return a*b

Answer:
Question 5 Selectable Answer
What is true about Python packages? (Select two answers)

Answer:
Question 6 Selectable Answer
What can you deduce from the following statement? (Select two answers)
str = open('file.txt', "rt")

Answer:
Question 7 Selectable Answer
What is the expected output of the following code?


Answer:
Question 8 Selectable Answer
What is the expected behavior of the following code?


Answer:
Question 9 Selectable Answer
The following expression
1+-2
is:

Answer:
Question 10 Selectable Answer
Which of the following lines of code will work flawlessly when put independently inside theadd_new () method in order to make the snippet's output equal to [0, 1, 1]? (Select two answers)


Answer:
Question 11 Selectable Answer
What is the expected output of the following code?


Answer:
Question 12 Selectable Answer
What is the expected output of the following code if existing_file is the name of a file located inside the working directory?


Answer:
Question 13 Selectable Answer
Assuming that the math module has been successfully imported, which of the following expressions evaluate to True?

Answer:
Question 14 Selectable Answer
The first parameter of each method:

Answer:
Explanation:
The first argument of every class method, including init, is always a reference to the current instance of the class. By convention, this argument is always named self. In the init method, self refers to the newly created object; in other class methods, it refers to the instance whose method was called
Question 15 Selectable Answer
Which of the following expressions evaluate to True? (Select two answers)

Answer:
Showing page 1 of 2
Next Page