PCAP - Exam: Website: VCE To PDF Converter: Facebook: Twitter
PCAP - Exam: Website: VCE To PDF Converter: Facebook: Twitter
exam
Number: PCAP
Passing Score: 800
Time Limit: 120 min
File Version: 1.0
Python PCAP
Website: https://vceplus.com
VCE to PDF Converter: https://vceplus.com/vce-to-pdf/
Facebook: https://www.facebook.com/VCE.For.All.VN/
Twitter : https://twitter.com/VCE_Plus
https://vceplus.com/
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Exam A
QUESTION 1
Assuming that the following snippet has been successfully executed, which of the equations are True? (Select two answers)
https://vceplus.com/
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 2
Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)
Correct Answer: AB
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 3
Which of the following statements are true? (Select two answers)
Correct Answer: BC
Section: (none)
Explanation
Explanation/Reference:
Reference: https://docs.python.org/2/tutorial/introduction.html
QUESTION 4
Which of the following sentences are true? (Select two answers)
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.afternerd.com/blog/python-lists-for-absolute-beginners/
QUESTION 5
Assuming that String is six or more letters long, the following
A. four chars
B. three chars
C. one char
D. two chars
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 6
What is the expected output of the following snippet?
A. 1
B. 4
C. 2
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. 3
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 7
What is the expected output of the following snippet?
A. abc
B. The code will cause a runtime exception
C. ABC
D. 123
Correct Answer: B
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 8
How many elements will the list2 list contain after execution of the following snippet?
https://vceplus.com/
A. zero
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
B. five
C. seven
D. three
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 9
What would you used instead of XXX if you want to check weather a certain ‘key’ exists in a dictionary called dict? (Select two answers))
A. ‘key’ in dict
B. dict [‘key’] != None
C. dict.exists (‘key’)
D. ‘key’ in dict.keys ( )
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Reference: https://thispointer.com/python-how-to-check-if-a-key-exists-in-dictionary/
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 10
You need data which can act as a simple telephone directory. You can obtain it with the following clauses (select two relevant variants; assume that no other
items have been created before)
Correct Answer: CD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 11
Can a module run like regular code?
A. yes, and it can differentiate its behavior between the regular launch and import
B. it depends on the Python version
C. yes, but in cannot differentiate its behavior between the regular launch and import
D. no, it is not possible; a module can be imported, not run
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
you write a module (a .py file) where it can be executed directly. Alternatively, it can also be imported and used in another module. By doing the main check, you
can have that code only execute when you want to run the module as a program and not have it execute when someone just wants to import your module and
call your functions themselves.
Reference: https://developer.rhino3d.com/guides/rhinopython/python-remote-local-module/
QUESTION 12
Select the valid fun () invocations:
(select two answers)
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
def fun (a, b=0):
return a*b
A. fun (b=1)
B. fun (a=0)
C. fun (b=1, 0)
D. fun (1)
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 13
A file name like this one below says
that: (select three answers) services,
cpython 36.pyc
Explanation/Reference:
QUESTION 14
What is the expected behavior of the following snippet?
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
It will:
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 15
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Is it possible to safely check if a class/object has a certain attribute?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Reference: https://stackoverflow.com/questions/610883/how-to-know-if-an-object-has-an-attribute-in-python
QUESTION 16
The first parameter of each method:
https://vceplus.com/
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Reference: https://pythontips.com/2013/08/07/the-self-variable-in-python-explained/
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 17
The simplest possible class definition in Python can be expressed as:
A. class X:
B. class X:
pass
C. class X:
return
D. class X: { }
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://docs.python.org/3/tutorial/classes.html
QUESTION 18
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:
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://stackoverflow.com/questions/32613375/python-2-7-exception-handling-syntax
QUESTION 19
A variable stored separately in every object is called:
A. there are no such variables, all variables are shared among objects
B. a class variable
C. an object variable
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. an instance variable
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://dev.to/ogwurujohnson/distinguishing-instance-variables-from-class-variables-in-python-81
QUESTION 20
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”)
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://en.wikibooks.org/wiki/Python_Programming/Input_and_Output
https://vceplus.com/
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com