Which 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, 21 ? (Select two answers)
self.queue.append(get_Iast() + 1)
queue.append(self.get last () + 1)
self.queue.append(self.queue[+1]
self.queue.append(self.get last() +1)
A file name like this one below says mat: (select three answers) services. cpython-36.pyc
the interpreter used to generate the file is version 3.6
it has been produced by CPython
it is the 36th version of the file
the file comes from the services . py source file
A compiler is a program designed to (select two answers)
rearrange the source code to make it clearer
check the source code in order to see if its correct
execute the source code
translate the source code into machine code
What is true about the following snippet? (Select two answers)
the code will raise an unhandled exception
the string I feel fine 'will be seen
the string it's nice to see you will be seen
the string what a pity will be seen
What is the expected behavior of the following code? It will:
print 4321
print <generator object f at (some hex digits)>
cause a runtime exception
print 1234
What is the expected behavior of the following code?
It outputs 123
it raises an exception
it outputs 321
it outputs 6
What is the expected output of the following code if existing_file is the name of a file located inside the working directory?
1 2
1 2 3
1 3
2 3
What is the expected behavior of the following code? It will:
print 0
cause a runtime exception
prints 3
print an empty line
The simplest possible class definition in Python can be expressed as:
class X:
class X: pass
class X: return
class X: {}
What is the expected output of the following code? def foo(x,y,z): return x(y) - x(z) print{f00(lambda x: x % 2, 2, 1) )
1
0
-1
an exception is raised