What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?
A. the length of the first line from the file
B. -1
C. the number of lines contained inside the file
D. the length of the last line from the file
Which of the following statement are true? (Select two answers)
A. closing an open file is performed by the closefile ( ) function
B. the second open ( ) argument describes the open mode and defaults to `w'
C. if open ( ) `s second argument is `r' the file must exist or open will fail
D. if open ( )'s second argument is `w' and the invocation succeeds, the previous file's content is lost
Files with the suffix .pyc contain:
A. Python 4 source code
B. backups
C. temporary data
D. semi-compiled Python code
If you need a function that does nothing, what would you use instead of XXX? (Select two answers) def idler ( ):
A. pass
B. return
C. exit
D. None
What is the expected output of the following snippet?
A. 1
B. 4
C. 2
D. 3
What is the expected behavior of the following code?
A. it outputs 1
B. it outputs 2
C. the code is erroneous and it will not execute
D. it outputs 3
What can you do if you don't like a long package path like this one?
A. you can make an alias for the name using the alias keyword
B. nothing, you need to come to terms with it
C. you can shorten it to alpha. zeta and Python will find the proper connection
D. you can make an alias for the name using the as keyword
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
A. <<<
B. >>>
C. >>
D. <<
Python strings can be "glued" together using the operator:
A. .
B. and
C. _
D. +
How many lines does the following snippet output?
A. three
B. one
C. two
D. four
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.