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.
Assuming that String is six or more letters long, the following slice
String[1:-2]
is shorter than the original string by:
Answer:
Question 4Selectable Answer
Select the valid fun () invocations:
(select two answers)
def fun (a, b=0):
return a*b
Answer:
Question 5Selectable Answer
What is true about Python packages? (Select two answers)
Answer:
Question 6Selectable Answer
What can you deduce from the following statement? (Select two answers)
str = open('file.txt', "rt")
Answer:
Question 7Selectable Answer
What is the expected output of the following code?
Answer:
Question 8Selectable Answer
What is the expected behavior of the following code?
Answer:
Question 9Selectable Answer
The following expression
1+-2
is:
Answer:
Question 10Selectable 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 11Selectable Answer
What is the expected output of the following code?
Answer:
Question 12Selectable 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 13Selectable Answer
Assuming that the math module has been successfully imported, which of the following expressions evaluate to True?
Answer:
Question 14Selectable 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 15Selectable Answer
Which of the following expressions evaluate to True? (Select two answers)