Logo ExamsQA
Exit
Free 0/10
1
Question

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)

Question image
Select 2
Options
A

self.queue.append(get_Iast() + 1)

B

queue.append(self.get last () + 1)

C

self.queue.append(self.queue[+1]

D

self.queue.append(self.get last() +1)

2
Question

A file name like this one below says mat: (select three answers) services. cpython-36.pyc

Select 3
Options
A

the interpreter used to generate the file is version 3.6

B

it has been produced by CPython

C

it is the 36th version of the file

D

the file comes from the services . py source file

3
Question

A compiler is a program designed to (select two answers)

Select 2
Options
A

rearrange the source code to make it clearer

B

check the source code in order to see if its correct

C

execute the source code

D

translate the source code into machine code

4
Question

What is true about the following snippet? (Select two answers)

Question image
Select 2
Options
A

the code will raise an unhandled exception

B

the string I feel fine 'will be seen

C

the string it's nice to see you will be seen

D

the string what a pity will be seen

5
Question

What is the expected behavior of the following code? It will:

Question image
Options
A

print 4321

B

print <generator object f at (some hex digits)>

C

cause a runtime exception

D

print 1234

6
Question

What is the expected behavior of the following code?

Question image
Options
A

It outputs 123

B

it raises an exception

C

it outputs 321

D

it outputs 6

7
Question

What is the expected output of the following code if existing_file is the name of a file located inside the working directory?

Question image
Options
A

1 2

B

1 2 3

C

1 3

D

2 3

8
Question

What is the expected behavior of the following code? It will:

Question image
Options
A

print 0

B

cause a runtime exception

C

prints 3

D

print an empty line

9
Question

The simplest possible class definition in Python can be expressed as:

Options
A

class X:

B

class X: pass

C

class X: return

D

class X: {}

10
Question

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) )

Options
A

1

B

0

C

-1

D

an exception is raised