Python Institute Associate Python Programmer (PCAP) Certification Sample Questions

Associate Python Programmer Dumps, PCAP Dumps, PCAP PDF, Associate Python Programmer VCE, Python Institute PCAP VCE, Python Institute PCAP-31-03 PDFThe purpose of this Sample Question Set is to provide you with information about the Python Institute Certified Associate Python Programmer exam. These sample questions will make you very familiar with both the type and the difficulty level of the questions on the PCAP certification test. To get familiar with real exam environment, we suggest you try our Sample Python Institute Associate Python Programmer Certification Practice Exam. This sample practice exam gives you the feeling of reality and is a clue to the questions asked in the actual Python Institute Certified Associate Python Programmer (PCAP) certification exam.

These sample questions are simple and basic questions that represent likeness to the real Python Institute PCAP exam questions. To assess your readiness and performance with real time scenario based questions, we suggest you prepare with our Premium Python Institute Associate Python Programmer Certification Practice Exam. When you solve real time scenario based questions practically, you come across many difficulties that give you an opportunity to improve.

Python Institute PCAP Sample Questions:

01. When working with modules, Python uses an optimization technique that creates a __pycache__ folder holding semi-compiled code. What extension does Python use for the files in that folder?
a) pyc
b) pc
c) py
d) pby
 
02. Which of the following literals reflect the value given as 34.23?
(Select 2 answers.)
a) .3423e-2
b) 3423e2
c) .3423e2
d) 3423e-2
 
03. inpt = ['Adam', 'Mary', 'Kate']
# enter your line here
print(res)
Which line, put in the marked place, makes the program print Adam-Mary-Kate?
a) res = ''.join(list(map(lambda x: x + '-', inpt)))
b) res = list(map(lambda x: x + '-', inpt))
c) res = '-'.join(inpt)
d) res = inpt.join('-')
 
04. You want to open the file test.txt and retrieve each line in it.
file = open('test.txt')
# insert code here
file.close()
Which options will you use?
(Select all that apply.)
a) for l in file: print(l)
b) print(file.lines())
c) print(file.read())
d) print(read.file(test.txt))
e) print(file.readlines())
f) print(readlines(file))
g) print(file.readline())
 
05. What will be the output of the following program?
try:
raise Exception(0, 1, [0, 1])
except Exception as e:
print(len(e.args))
a) Python will raise an exception
b) 2
c) 3
d) 0
 
06. Suppose that a file was correctly opened as the text stream stream, all of its content has already been read, and the cursor now points to the end of the file.
What will happen if we invoke read(10) on the stream?
a) The function will return the last character from the file
b) The function will return an empty string
c) The function will raise an error
d) The function will return the last 10 characters from the stream
 
07. Given the following definition, how can you reach __prop from outside the class?
class Sample:
def __init__(self):
self.__prop = 'a'
Assume the object was built with mysamp = Sample().
a) mysamp._Sample__prop
b) mysamp.__prop
c) mysamp.prop
d) mysamp._Sample_prop
 
08. What can you deduce from the following statement?
str = open('file.txt', "rt")
(Select 2 answers.)
a) if file.txt does not exist, it will be created
b) the opened file cannot be written with the use of the str variable
c) str is a string read in from the file named file.txt
d) a new line character translation will be performed during the reads
 
09. inpt = ['Adam', 'Mary', 'Kate']
# enter your line here
print(res)
Which line, put in the marked place, makes the program print Adam-Mary-Kate?
a) res = ''.join(list(map(lambda x: x + '-', inpt)))
b) res = list(map(lambda x: x + '-', inpt))
c) res = '-'.join(inpt)
d) res = inpt.join('-')
 
10. Which of the following file modes does not allow writing into the file?
a) a
b) r+
c) w
d) r

Answers:

Question: 01
Answer: a
Question: 02
Answer: c, d
Question: 03
Answer: c
Question: 04
Answer: a, c, e
Question: 05
Answer: c
Question: 06
Answer: b
Question: 07
Answer: a
Question: 08
Answer: b, d
Question: 09
Answer: c
Question: 10
Answer: d

Note: For any error in Python Institute Certified Associate Python Programmer (PCAP) certification exam sample questions, please update us by writing an email on feedback@edusum.com.

Rating: 4.8 / 5 (187 votes)