Test
PCAP
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (141)
1What will be the value of the i variable when the while e loop finishes its execution?

- A1
- B0
- C2
- Dthe variable becomes unavailable
2What is the expected output of the following snippet?

- A3
- B1
- C2
- Dthe code is erroneous
3What is true about Python class constructors? (Choose two.)
- Athere can be more than one constructor in a Python class
- Bthe constructor must return a value other than None
- Cthe constructor is a method named __init__
- Dthe constructor must have at least one parameter
4Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Choose two.)

- Aisinstance (obj_b,A)
- BA.VarA == 1
- Cobj_a is obj_aa
- DB.VarA == 1
5Assuming that the code below has been executed successfully, which of the expressions evaluate to True? (Choose two.)

- Alen(Class.__dict__) == 1
- B'data' in Class.__dict__
- C'var' in Class.__dict__
- D'data' in Object.__dict__
6A property that stores information about a given class's super-classes is named:
- A__upper__
- B__super__
- C__ancestors__
- D__bases__
7Which of the following lines of code will work flawlessly when put independently inside the add_new() method in order to make the snippet's output equal to [0, 1, 2]? (Choose two.)

- Aself.queue.append(self.get_last() + 1)
- Bself.queue.append(get_last() + 1)
- Cself.queue.append(self.queue[-1] + 1)
- Dqueue.append(self.get_last() + 1)
8What is the expected output of the following code?

- Aa
- Bc
- Can exception is raised
- Db
9What is the expected output of the following code if there is no file named non_existing_file inside the working directory?

- A1 2 4
- B1 2 3 4
- C2 4
- D1 3
10What 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?

- Athe length of the first line from the file
- B-1
- Cthe number of lines contained inside the file
- Dthe length of the last line from the file
11What is the expected behavior of the following code?

- Ait outputs [1, 3]
- Bthe code is erroneous and it will not execute
- Cit outputs [3, 1]
- Dit outputs [4, 2, 0]
12Assuming that the following code has been executed successfully, which of the expressions evaluate to True? (Choose two.)

- Ab() == 4
- Ba != b
- Ca is not None
- Da() == 4
13Assuming that the following snippet has been successfully executed, which of the equations are True? (Choose two.)

- Alen(a) == len (b)
- Bb [0] +1 ==a [0]
- Ca [0] == b [0]
- Da [0] + 1 ==b [0]
14What is the expected output of the following code?

- A3
- B5
- C4
- Dan exception is raised
15Which of the following lambda definitions are correct? (Choose two.)
- Alambda x,y: (x,y)
- Blambda x,y: return x//y - x%y
- Clambda x,y: x//y - x%y
- Dlambda x,y = x//y - x%y
16Which of the following statements are true? (Choose two.)
- Aif invoking open () fails, an exception is raised
- Bopen () requires a second argument
- Copen () is a function which returns an object that represents a physical file
- Dinstd, outstd. errstd are the names of pre-opened streams
17What is the expected behavior of the following code?

- Athe code is erroneous and it will not execute
- Bit outputs 1
- Cit outputs -1
- Dit outputs 0
18Which of the following snippets will execute without raising any unhandled exceptions? (Choose two.)
- AA

- BB

- CC

- DD

- AA
19Which of the following expressions evaluate to True? (Choose two.)
- A'8' + '8' !=2 * '8'
- B'xYz'.lower() > 'XY'
- Cfloat('3.14') == str('3.' + '14')
- D121 + 1 ==int('1' + 2 * '2')
20What is the expected behavior of the following code?

- Ait raises an exception
- Bit outputs 3
- Cit outputs 1
- Dit outputs 6
21What is the expected behavior of the following code?

- Athe code is erroneous and it will not execute
- Bit outputs 2.0
- Cit outputs 2.5
- Dit outputs 3.0
22What is the expected behavior of the following code?

- Ait outputs [4, 2]
- Bit outputs [2, 4]
- Cit outputs [0, 1, 2, 3, 4]
- Dthe code is erroneous and it will not execute
23The __bases__ property contains:
- Abase class location (addr)
- Bbase class objects (class)
- Cbase class names (str)
- Dbase class ids (int)
24Assuming that the following snippet has been successfully executed, which of the equations are False? (Choose two.)

- Alen(a)== len (b)
- Ba [0]-1 ==b [0]
- Ca [0]== b [0]
- Db [0] - 1 ==a [0]
25What is the expected behavior of the following code?

- Ait outputs 0
- Bit raises an exception
- Cit outputs 1
- Dit outputs 2
26Which of the following statements are true? (Choose two.)
- Aan escape sequence can be recognized by the / sign put in front of it
- BII in ASCII stands for Internal Information
- CASCII is a subset of UNICODE
- Da code point is a number assigned to a given character
27What is the expected behavior of the following code?

- Ait outputs 321
- Bit outputs 123
- Cit outputs 6
- Dit raises an exception
28A Python module named pymod.py contains a variable named pyvar.
Which of the following snippets will let you access the variable? (Choose two.)- Aimport pymod pymod.pyvar = 1
- Bimport pyvar from pymod pyvar = 1
- Cfrom pymod import pyvar pyvar ()
- Dfrom pyfun import * pyvar = 1
29Which of the following expressions evaluate to True? (Choose two.)
- Aord(ג€zג€) - ord(ג€Zג€) == ord(ג€0ג€)
- Blen(ג€ג€ג€ ג€ג€ג€) > 0
- Cchr(ord('a') + 1) == 'B'
- Dlen('\'') == 1
30What is the expected output of the following code if the file named non_zero_length_existing_text_file is a non-zero length file located inside the working directory?

- A-1
- B0
- Can errno value corresponding to file not found
- D1
31Assuming that the code below has been executed successfully, which of the expressions evaluate to True? (Choose two.)

- A'var' in Class.__dict__
- B'var' in Object.__dict__
- Clen(Object.__dict__) == 1
- D'prop' in Class.__dict__
32What is the expected behavior of the following code?

- Ait raises an exception
- Bit outputs nothing
- Cit outputs True
- Dit outputs False
33Assuming that the code below has been executed successfully, which of the following expressions will always evaluate to True? (Choose two.)

- Av1 == v2
- Bv1 < 1
- Crandom.choice([1,2,3]) > 0
- Dlen(random.sample([1,2,3],1)) > 2
34With regards to the directory structure below, select the proper forms of the directives in order to import module_b. (Choose two.)

- Afrom pyback.upper import module_b
- Bimport pyback.upper.module_b
- Cimport upper.module_b
- Dimport module_b
35Which of the following statements are true? (Choose two.)
- APython strings are actually lists
- BPython strings can be concatenated
- CPython strings can be sliced like lists
- DPython strings are mutable
36Which of the following lines of code will work flawlessly when out independently inside the inc() method in order to make the snippet's output equal to 3?
(Choose two.)
- Aput(self.prop + val)
- Bself.put(get() + val)
- Cself.put(self.get() + val)
- Dself.put(self.prop + val)
37What is the expected output of the following code?

- AFalse
- B0
- CNone
- DTrue
38What is true about Python class constructors? (Choose two.)
- Athere can be only one constructor in a Python class
- Bthe constructor cannot be invoked directly under any circumstances
- Cthe constructor cannot return a result other than None
- Dthe constructor's first parameter must always be named self
39What is the expected behavior of the following code?

- A4
- B3
- Can exception is raised
- D5
40Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Choose two.)

- Aclass Class_3(A,C): pass
- Bclass Class_4(C,B): pass
- Cclass Class_1(D): pass
- Dclass Class_2(A,B): pass
41What is the expected behavior of the following code?

- Ait outputs 0
- Bthe code is erroneous and it will not execute
- Cit outputs 1
- Dit outputs 2
42Which of the following expressions evaluate to True? (Choose two.)
- A'in' in 'Thames'
- B'in' in 'in'
- C'in not' in 'not'
- D't'.upper() in 'Thames'
43What is the expected behavior of the following code?

- Ait outputs 2
- Bit raises an exception
- Cit outputs 1
- Dit outputs 0
44Which of the following invocations are valid? (Choose two.)
- Asort(ג€pythonג€)
- Bג€pythonג€.find(ג€ג€)
- Cג€pythonג€.rindex(ג€thג€)
- D'python'.sorted()
45What is the expected output of the following snippet?

- ATrue lower
- BTrue upper
- CFalse upper
- DFalse lower
46Which of the following sentences are true? (Choose two.)
- ALists may not be stored inside tuples
- BTuples may be stored inside lists
- CTuples may not be stored inside tuples
- DLists may be stored inside lists
47Assuming that the snippet below has been executed successfully, which of the following expressions evaluate to True? (Choose two.) string = 'SKY'[::-1] string = string[-1]
- Astring[0] == 'Y'
- Bstring[0] == string [-1]
- Cstring is None
- Dlen(string) == 1
48Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True?

- AClassA.__module__ == '__main__'
- B__name__ == '__main__'
- Cstr(Object) == 'Object'
- Dlen(ClassB.__bases__) == 2
49Assuming that String is six or more letters long, the following slice is shorter than the original string by:

- Afour chars
- Bthree chars
- Cone char
- Dtwo chars
50What is the expected output of the following snippet?

- A1
- B4
- C2
- D3
51What is the expected output of the following snippet?

- Aabc
- BThe code will cause a runtime exception
- CABC
- D123
52How many elements will the list2 list contain after execution of the following snippet?

- Azero
- Bfive
- Cseven
- Dthree
53What would you used instead of XXX if you want to check weather a certain 'key' exists in a dictionary called dict? (Choose two.)

- A'key' in dict
- Bdict ['key'] != None
- Cdict.exists ('key')
- D'key' in dict.keys ( )
54And operator able to perform bitwise shifts is coded as (Choose two.)
- A--
- B++
- C<<
- D>>
55You need data which can act as a simple telephone directory. You can obtain it with the following clauses (Choose two.) (assume that no other items have been created before)
- Adir={'Mom': 5551234567, 'Dad': 5557654321}
- Bdir= {'Mom': '5551234567', 'Dad': '5557654321'}
- Cdir= {Mom: 5551234567, Dad: 5557654321}
- Ddir= {Mom: '5551234567', Dad: '5557654321'}
56Can a module run like regular code?
- Ayes, and it can differentiate its behavior between the regular launch and import
- Bit depends on the Python version
- Cyes, but in cannot differentiate its behavior between the regular launch and import
- Dno, it is not possible; a module can be imported, not run
57Select the valid fun () invocations: (Choose two.)

- Afun (b=1)
- Bfun (a=0)
- Cfun (b=1, 0)
- Dfun (1)
58A file name like this one below says that: (Choose three.)
services, cpython 36.pyc- Athe interpreter used to generate the file is version 3.6
- Bit has been produced by CPython
- Cit is the 36 version of the file
- Dthe file comes from the services.py source file
59What is the expected behavior of the following snippet? It will:

- Acause a runtime exception
- Bprint 1
- Cprint 0, [1]
- Dprint [1]
60What can you do if you don't like a long package path like this one?

- Ayou can make an alias for the name using the alias keyword
- Bnothing, you need to come to terms with it
- Cyou can shorten it to alpha . zeta and Python will find the proper connection
- Dyou can make an alias for the name using the as keyword
61What is the expected output of the following code?

- Aabcef
- BThe program will cause a runtime exception/error
- Cacdef
- Dabdef
62What is the expected output of the following code?

- A21
- B2
- C3
- D12
63What is the expected behavior of the following snippet? It will:

- Acause a runtime exception on line 02
- Bcause a runtime exception on line 01
- Ccause a runtime exception on line 03
- Dprint 3
64What is the expected behavior of the following code?
It will:
- Aprint 4321
- Bprint <generator object f at (some hex digits)>
- Ccause a runtime exception
- Dprint 1234
65What will the value of the i variable be when the following loop finishes its execution?

- A10
- Bthe variable becomes unavailable
- C11
- D9
66If you need a function that does nothing, what would you use instead of XXX? (Choose two.)

- Apass
- Breturn
- Cexit
- DNone
67Is it possible to safely check if a class/object has a certain attribute?
- Ayes, by using the hasattr attribute
- Byes, by using the hasattr ( ) method
- Cyes, by using the hasattr ( ) function
- Dno, it is not possible
68The first parameter of each method:
- Aholds a reference to the currently processed object
- Bis always set to None
- Cis set to a unique random value
- Dis set by the first argument's value
69The simplest possible class definition in Python can be expressed as:
- Aclass X:
- Bclass X: pass
- Cclass X: return
- Dclass X: { }
70If 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:
- Aexcept Exception (e) :
- Bexcept e= Exception :
- Cexcept Exception as e:
- Dsuch an action is not possible in Python
71A variable stored separately in every object is called:
- Athere are no such variables, all variables are shared among objects
- Ba class variable
- Can object variable
- Dan instance variable
72There is a stream named s open for writing. What option will you select to write a line to the stream?
- As. write (ג€Hello\nג€)
- Bwrite (s, ג€Helloג€)
- Cs.writeln (ג€Helloג€)
- Ds. writeline (ג€Helloג€)
73You are going to read just one character from a stream called s. Which statement would you use?
- Ach = read (s, 1)
- Bch= s.input (1)
- Cch= input (s, 1)
- Dch= s.read (1)
74What can you deduce from the following statement? (Choose two.)

- Astr is a string read in from the file named file.txt
- Ba newline character translation will be performed during the reads
- Cif file. txt does not exist, it will be created
- Dthe opened file cannot be written with the use of the str variable
75The following class hierarchy is given. What is the expected output of the code?

- ABB
- BCC
- CAA
- DBC
76The following expression 1+-2 is:
- Aequal to 1
- Binvalid
- Cequal to 2
- Dequal to -1
77Python's built in function named open () tries to open a file and returns:
- Aan integer value identifying an opened file
- Ban error code (0 means success)
- Ca stream object
- Dalways None
78Which of the following words can be used as a variable name? (Choose two.)
- Afor
- BTrue
- Ctrue
- DFor
79Python strings can be `glued` together using the operator:
- A.
- B&
- C_
- D+
80A keyword (Choose two.)
- Acan be used as an identifier
- Bis defined by Python's lexis
- Cis also known as a reserved word
- Dcannot be used in the user's code
81How many stars (*) does the snippet print?
- Athe code is erroneous
- Bfive
- Cfour
- Dtwo
82Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Choose two.)
Expected output:
1 2 3
Code:
- Ac, b, a = b, a, c
- Bc, b, a = a, c, b
- Ca, b, c = c, a, b
- Da, b, c = a, b, c
83Assuming 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<<
84How many stars (*) does the following snippet print?

- Athe code is erroneous
- Bfive
- Cthree
- Dfour
85UNICODE is:
- Athe name of an operating system
- Ba standard for encoding and handling texts
- Cthe name of a programming language
- Dthe name of a text processor
86What is the expected output of the following snippet?

- A*- **-**-**-*
- B*-**-**-**-**-**-**-**-*
- C*-*
- D*-**-*
87A compiler is a program designed to (Choose two.)
- Arearrange the source code to make it clearer
- Bcheck the source code in order to see of it's correct
- Cexecute the source code
- Dtranslate the source code into machine code
88Which of the listed actions can be applied to the following tuple? (Choose two.)
tup = ()- Atup [:]
- Btup.append (0)
- Ctup [0]
- Ddel tup
89Executing the following snippet will cause the dct:

- Ato hold two keys named 'pi' linked to 3.14 and 3.1415 respectively
- Bto hold two key named 'pi' linked to 3.14 and 3.1415
- Cto hold one key named 'pi' linked to 3.1415
- Dto hold two keys named 'pi' linked to 3.1415
90How many elements will the list1 list contain after execution of the following snippet?

- Atwo
- Bzero
- Cone
- Dthree
91Which of the equations are True? (Choose two.)
- Achr (ord (x)) = = x
- Bord (ord (x)) = = x
- Cchr (chr (x)) = = x
- Dord (chr (x)) = = x
92If you want to transform a string into a list of words, what invocation would you use? (Choose two.)
Expected output:
The, Catcher, in, the Rye,
Code:
- As.split()
- Bsplit (s, ' ')
- Cs.split(' ')
- Dsplit (s)
93Assuming that: code
is a four-element list is there any difference between these two statements?
- Ayes, there is, the first line empties the list, the second line deletes the list as a whole
- Byes, there is, the first line deletes the list as a whole, the second line just empties the list
- Cno, there is no difference
- Dyes, there is, the first line deletes the list as a whole, the second line removes all the elements except the first one
94What should you put instead of XXX to print out the module name?

- Amain
- B_main_
- C__main__
- D___main___
95Files with the suffix .pyc contain:
- APython 4 source code
- Bbackups
- Ctemporary data
- Dsemi-compiled Python code
96Package source directories/folders can be:
- Aconverted into the so-called pypck format
- Bpacked as a ZIP file and distributed as one file
- Crebuilt to a flat form and distributed as one directory/folder
- Dremoved as Python compiles them into an internal portable format
97What can you deduce from the line below? (Choose two.)
x = a.b.c.f ()- Aimport a.b.c should be placed before that line
- Bf () is located in subpackage c of subpackage b of package a
- Cthe line is incorrect
- Dthe function being invoked is called a.b.c.f ()
98What is the output of the following piece of code?

- Aant' bat' camel
- Bant"bat"camel
- Cantbatcamel
- Dprint (a, b, c, sep= ' " ')
99A two-parameter lambda function raising its first parameter to the power of the second parameter should be declared as:
- Alambda (x, y) = x ** y
- Blambda (x, y): x ** y
- Cdef lambda (x, y): return x ** y
- Dlambda x, y: x ** y
100What is the expected output of the following code?

- A21
- B12
- C3
- Dnone
101A method for passing the arguments used by the following snippet is called:

- Asequential
- Bnamed
- Cpositional
- Dkeyword
102What is the expected behavior of the following code?

- Aprint 2 1
- Bprint 1 2
- Ccause a runtime exception
- Dprint <generator object f at (some hex digits)>
103What is the expected output of the following code?

- A2
- BThe code will cause a runtime exception
- C1
- D3
104What is the expected behavior of the following code?

- Aprint 0
- Bcause a runtime exception
- Cprints 3
- Dprint an empty line
105If any of a class's components has a name that starts with two underscores (___), then:
- Athe class component's name will be mangled
- Bthe class component has to be an instance variable
- Cthe class component has to be a class variable
- Dthe class component has to be a method
106If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:
- Aexcept Ex1 Ex2:
- Bexcept (Ex1, Ex2):
- Cexcept Ex1, Ex2:
- Dexcept Ex1+Ex2:
107A function called issubclass (c1, c2) is able to check if:
- Ac1 and c2 are both subclasses of the same superclass
- Bc2 is a subclass of c1
- Cc1 is a subclass of c2
- Dc1 and c2 are not subclasses of the same superclass
108A class constructor (Choose two.)
- Acan return a value
- Bcannot be invoked directly from inside the class
- Ccan be invoked directly from any of the subclasses
- Dcan be invoked directly from any of the superclasses
109What is the expected output of the following snippet?

- Athe code is erroneous
- B3
- C7
- D15
110The 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 should be used instead of XXX?

- Aprint (get(self))
- Bprint (self.get())
- Cprint (get())
- Dprint (self.get (val))
111If S is a stream open for reading, what do you expect from the following invocation?
c = s.read()- Aone line of the file will be read and stored in the string called C
- Bthe whole file content will be read and stored in the string called C
- Cone character will be read and stored in the string called C
- Done disk sector (512 bytes) will be read and stored in the string called C
112You are going to read 16 bytes from a binary file into a bytearray called data. Which lines would you use? (Choose two.)
- Adata = bytearray (16) bf.readinto (data)
- Bdata = binfile.read (bytearray (16))
- Cbf. readinto (data = bytearray (16))
- Ddata = bytearray (binfile.read (16))
113What is the expected output of the following snippet?

- ATrue False
- BTrue True
- CFalse False
- DFalse True
114Assuming that the code below has been executed successfully, which of the following expressions will always evaluate to True? (Choose two.)

- Av1 >= 1
- Bv1 == v2
- Clen(random.sample([1,2,3],2)) > 2
- Drandom.choice([1,2,3]) >=1
115Which one of the platform module functions should be used to determine the underlying platform name?
- Aplatform.python_version()
- Bplatform.processor()
- Cplatform.platform()
- Dplatform.uname()
116What is the expected output of the following code?

- AFalse
- BNone
- CTrue
- D0
117With regards to the directory structure below, select the proper forms of the directives in order to import module_a. (Choose two.)

- Afrom pypack import module_a
- Bimport module_a from pypack
- Cimport module_a
- Dimport pypack.module_a
118A Python module named pymod.py contains a function named pyfun().
Which of the following snippets will let you invoke the function? (Choose two.)- Aimport pymod pymod.pyfun()
- Bfrom pymod import pyfun pyfun()
- Cfrom pymod import * pymod.pyfun()
- Dimport pyfun from pymod pyfun()
119What is true about Python packages? (Choose two.)
- Aa package is a single file whose name ends with the pa extension
- Ba package is a group of related modules
- Cthe __name__ variable always contains the name of a package
- Dthe pyc extension is used to mark semi-compiled Python packages
120How many lines does the following snippet output?

- Athree
- Bone
- Ctwo
- Dfour
121What is the expected behavior of the following code?

- Ait outputs 3
- Bit outputs 1
- Cthe code is erroneous and it will not execute
- Dit outputs 2
122What is the expected behavior of the following code?

- Ait outputs 3
- Bthe code is erroneous and it will not execute
- Cit outputs 1
- Dit outputs 2
123Which of the following snippets will execute without raising any unhandled exceptions? (Choose two.)
- AA

- BB

- CC

- DD

- AA
124What is the expected behavior of the following code?

- Ait outputs error
- Bit outputs <class 'IndexError'>
- Cit outputs list assignment index out of range
- Dthe code is erroneous and it will not execute
125What is true about the following snippet? (Choose two.)

- Athe string it's nice to see you will be seen
- Bthe string I feel fine will be seen
- Cthe code will raise an unhandled exception
- Dthe string what a pity will be seen
126Which of the following expressions evaluate to True? (Choose two.)
- Aord(ג€Zג€) - ord(ג€zג€) == ord(ג€0ג€)
- Bchr(ord('A') +1) == 'B'
- Clen('\'') == 1
- Dlen(ג€ג€ג€ ג€ג€ג€) == 0
127Which of the following invocations are valid? (Choose two.)
- Aג€pythonג€.sort()
- Bsorted(ג€pythonג€)
- Crfind(ג€pythonג€,ג€rג€)
- Dג€pythonג€.index(ג€thג€)
128What is the expected behavior of the following code?

- Ait raises an exception
- Bit outputs 0
- Cit outputs 3
- Dit outputs 'None'
129Which of the following statements are true? (Choose two.)
- AII in ACII stands for Information Interchange
- Ba code point is a number assigned to a given character
- CACII is synonymous with UTF-8
- D\e is an escape sequence used to mark the end of lines
130Which of the following expressions evaluate to True? (Choose two.)
- Astr(1-1) in '123456789'[:2]
- B'dcb' not in 'abcde'[::-1]
- C'phd' in 'aplpha'
- D'True' not in 'False'
131Which of the following literals reflect the value given as 34.23? (Choose two.)
- A.3423e2
- B3423e-2
- C.3423e-2
- D3423e2
132What is the expected behavior of the following code?

- Ait raises an exception
- Bit outputs True
- Cit outputs False
- Dit outputs nothing
133Which of the following expressions evaluate to True? (Choose two.)
- A121 + 1 != '1' + 2 * '2'
- B'1' + '1' + '1' < '1' *3'
- C'AbC'.lower() < 'AB'
- D'3.14' != str(3.1415)
134Assuming that the snippet below has been executed successfully, which of the following expressions evaluate to True? (Choose two.) string = 'python'[::2] string = string[-1] + string[-2]
- Astring[0] == 'o'
- Bstring is None
- Clen(string) == 3
- Dstring[0] == string [-1]
135What is the expected behavior of the following code?

- Ait outputs 0
- Bit outputs 1
- Cit raises an exception
- Dit outputs 2
136Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Choose two.)

- Aclass Class_4(D,A): pass
- Bclass Class_3(A,C): pass
- Cclass Class_2(B,D): pass
- Dclass Class_1(C,D): pass
137What is the expected output of the following snippet?

- ATrue upper
- BTrue lower
- CFalse upper
- DFalse lower
138Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True?
(Choose two.)
- Alen(ClassB.__bases__) ==2
- BClassA.__module__ == '__main__'
- C__name__ == 'code.py'
- Dstr(Object) == 'Object'
139What is the expected behavior of the following code?

- Ait outputs 1
- Bit outputs 3
- Cit outputs 6
- Dit raises an exception
140What is the expected behavior of the following code?

- Ait outputs 0
- Bit raises an exception
- Cit outputs 1
- Dit outputs 2
141What is true about Object-Oriented Programming in Python? (Choose two.)
- Aeach object of the same class can have a different set of methods
- Ba subclass is usually more specialized than its superclass
- Cif a real-life object can be described with a set of adjectives, they may reflect a Python object method
- Dthe same class can be used many times to build a number of objects
Información
- Descripción
- Test sobre PCAP, creado por Mihai Cristian Tabarcea el 12/01/2026.
- Idioma
- English
- Visitas
- 0
- Valoración
- Aún sin valoraciones Valora este test