PCAP-31-03 Exam Questions
152 real PCAP-31-03 exam questions with expert-verified answers and explanations. Page 2 of 4.
- Question #55
An operator able to perform bitwise shifts is coded as (select two answers)
- Question #56Technology and architecture
What will the value of the i variable be when the following loop finishes its execution?
for loopvariable scopeloop executionPython control flow - Question #57
The following expression 1+-2 is:
- Question #58
A compiler is a program designed to (select two answers)
- Question #59
What is the output of the following piece of code?
- Question #60Technology and architecture
What is the expected output of the following snippet?
Python syntaxerror detectioncode analysissnippet evaluation - Question #61Technology and architecture
How many lines does the following snippet output?
Python outputprint functioncode tracingline counting - Question #62
Which of the following literals reflect the value given as 34.23? (select two answers)
- Question #63Technology and architecture
What is the expected output of the following snippet?
Python codeerror detectionoutput predictioncode analysis - Question #64Technology and architecture
Assuming that the following snippet has been successfully executed, which of the equations are True? (Select two answers)
Python listsindexinglist operationsequality comparison - Question #65Technology and architecture
Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)
Python listslist operationsfalse conditionsequality comparison - Question #66Technology and architecture
Which of the following statements are true? (Select two answers)
Python stringsconcatenationslicingstring mutability - Question #67
Which of the following sentences are true? (Select two answers)
- Question #68
Assuming that String is six or more letters long, the following slice String[1:-2] is shorter than the original string by:
- Question #69
What is the expected output of the following snippet?
- Question #71
How many elements will the list2 list contain after execution of the following snippet?
- Question #72
What would you use instead of XXX if you want to check whether a certain ` key' exists in a dictionary called diet? (Select two answers)
- Question #73Technology and architecture
You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been create...
Python dictionariesdict syntaxdata structureskey-value pairs - Question #74Technology and architecture
Can a module run like regular code?
Python modulesmodule importmodule execution__name__ variable - Question #75
Select the valid fun () invocations: (select two answers)
- Question #76
A file name like this one below says mat: (select three answers) services. cpython-36.pyc
- Question #77
What is the expected behavior of the following snippet? It will:
- Question #78
What can you do if you don't like a long package path tike this one?
- Question #79
What is the expected output of the following code?
- Question #80
What is the expected output of the following code?
- Question #82
What is the expected behavior of the following code? It will:
- Question #83
If you need a function that does nothing, what would you use instead of XXX? (Select two answers)
- Question #84
What is the expected behavior of the following code? It will:
- Question #85Technology and architecture
The first parameter of each method:
Python OOPself parametermethod definitionobject reference - Question #86
The simplest possible class definition in Python can be expressed as:
- Question #87
If you want to access an exception object's components and store them in an object called e, you have to use the following form of exception statement
- Question #88
A variable stored separately in every object is called:
- Question #89
There is a stream named s open for writing. What option will you select to write a line to the stream''
- Question #90
You are going to read just one character from a stream called s. Which statement would you use?
- Question #91
What can you deduce from the following statement? (Select two answers)
- Question #92
The following class hierarchy is given. What is the expected output of the code?
- Question #93
Python's built-in function named open () tries to open a file and returns:
- Question #94
A class constructor (Select two answers)
- Question #95
Which of the listed actions can be applied to the following tuple? (Select two answers)
- Question #96
What is the expected output of the following snippet?
- Question #97
Assuming that the V variable holds an integer value to 2, which of the following operators should be used instead of OPER to make the expression equal to 1? V OPER 1 -
- Question #98
Which of the following words can be used as a variable name? (Select two valid names)
- Question #99
How many elements will the list1 list contain after execution of the following snippet?
- Question #100
If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:
- Question #101
What is the expected behavior of the following code? It will:
- Question #102
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 shoul...
- Question #104
If you want to transform a string into a list of words, what invocation would you use? (Select two answers) Expected output:
- Question #105
You are going to read 16 bytes from a binary file into a bytearray called data. Which lines would you use? (Select two answers)
- Question #106
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:
- Question #107
Which of the equations are True? (Select two answers)