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: { }
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
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
D. an instance variable
UNICODE is:
A. the name of an operating system
B. a standard for encoding and handling texts
C. the name of a programming language
D. the name of a text processor
If you want to transform a string into a list of words, what invocation would you use? (Select two answers)
Expected output:
Code:
A. s.split ()
B. split (s, ` `)
C. s.split (` `)
D. split (s)
A method for passing the arguments used by the following snippet is called:
A. sequential
B. named
C. positional
D. keyword
Assuming that the code below has been executed successfully, which of the following expressions will always evaluate to True? (Choose two.)
A. v1 >= 1
B. v1 == v2
C. len(random.sample([1,2,3],2)) > 2
D. random.choice([1,2,3]) >=1
What is the expected behavior of the following code?
A. it outputs 3
B. the code is erroneous and it will not execute
C. it outputs 1
D. it outputs 2
What is the expected behavior of the following code?
A. it outputs [1, 3]
B. the code is erroneous and it will not execute
C. it outputs [3, 1]
D. it outputs [4, 2, 0]
Assuming 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__
C. len(Object.__dict__) == 1
D. `prop' in Class.__dict__