The following class hierarchy is given. What is the expected output of the code?
A. BB
B. CC
C. AA
D. BC
What is the expected behavior of the following code?
A. it outputs 'None'
B. it outputs 3
C. it raises an exception
D. it outputs 0
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
There is a stream named s open for writing. What option will you select to write a line to the stream''
A. s.write("Hello\n")
B. write(s, "Hello")
C. s.writeln("Hello")
D. s.writeline("Hello")
The following expression 1+-2 is:
A. equal to 1
B. invalid
C. equal to 2
D. equal to -1
What is the expected behavior of the following code?
A. it outputs 3
B. it outputs 1
C. it outputs 6
D. it raises an exception
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
If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:
A. except Ex1 Ex2:
B. except (ex1, Ex2):
C. except Ex1, Ex2:
D. except Ex1+Ex2:
Which of the following words can be used as a variable name? (Select two valid names)
A. for
B. True
C. true
D. For
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
A. except Exception(e):
B. except e=Exception:
C. except Exception as e:
D. such an action is not possible in Python
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Python Institute exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your PCAP-31-03 exam preparations and Python Institute certification application, do not hesitate to visit our Vcedump.com to find your solutions here.