EMT Practice Test

1. Question Content...


Question List

Question1: Which of the following statements are true? (Select two answers)

Question2: What would you use instead of XXX if you want to check whether a certain ' key' exists in a dictionary called diet? (Select two answers) II if XXX:
print("Key exists")

Question3: Which of the following invocations are valid? (Select two answers)

Question4: Assuming that the following snippet has been successfully executed, which of the equations are True? (Select two answers)

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

Question6: Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers)

Question7: If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:

Question8: Which of the listed actions can be applied to the following tuple? (Select two answers)

Question9: What is the expected behavior of the following code?

Question10: 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

Question11: What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?

Question12: 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, 1] ? (Select two answers)

Question13: Which of the following lambda definitions are correct? (Select two answers)

Question14: Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Select two answers)

Question15: What is the expected behavior of the following code?

Question16: You are going to read just one character from a stream called s. Which statement would you use?

Question17: What can you deduce from the following statement0 (Select two answers) str = open('file.txt', "rt")

Question18: What is the expected behavior of the following code?

Question19: Executing the following snippet

will cause the dct:

Question20: What is the expected behavior of the following code?

Question21: Which of the following expressions evaluate to True? (Select two answers)

Question22: The first parameter of each method:

Question23: A Python module named pymod, py contains a function named pyfun ( ).
Which of the following snippets will let you invoke the function? (Select two answers)

Question24: What is the expected behavior of the following code?

Question25: A property that stores information about a given class's super-classes is named:

Question26: Assuming that the code below has been executed successfully, which of the following expressions will always evaluate to True? (Select two answers) import random v1 = random. random() v2 = random. random()

Question27: What is the expected behavior of the following code?

Question28: What will the value of the i variable be when the following loop finishes its execution?

Question29: What is the expected output of the following code?

Question30: What is true about Object-Oriented Programming in Python? (Select two answers)

Question31: If you want to transform a string into a list of words, what invocation would you use? (Select two answers) Expected output:

Question32: Assuming that the following inheritance set is in force, which of the following classes are declared properly?
(Select two answers)

Question33: Which of the following statements are true? (Select two answers)

Question34: There is a stream named s open for writing. What option will you select to write a line to the stream''

Question35: Which one of the platform module functions should be used to determine the underlying platform name?

Question36: What is the expected behavior of the following code?

It will:

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

Question38: What is the expected behavior of the following code?

Question39: Is it possible to safely check if a class/object has a certain attribute?

Question40: Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)

Question41: With regards to the directory structure below, select the proper forms of the directives in order to import module_a. (Select two answers)

Question42: What is true about Object-Oriented Programming in Python? (Select two answers)

Question43: You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been created before)

Question44: A variable stored separately in every object is called:

Question45: What is the expected behavior of the following code?

Question46: What 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?

Question47: What is the expected behavior of the following code?

Question48: Which of the following expression evaluate to True? (Select two answers) A)

B)

C)

D)

Question49: Assuming that the math module has been successfully imported, which of the following expressions evaluate to True? (Select two answers)

Question50: Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers)

Question51: What is the expected output of the following code?

Question52: What is the expected output of the following snippet?

Question53: What is the expected behavior of the following code?

Question54: What is the output of the following piece of code?

Question55: The 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?

Question56: Assuming 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 -

Question57: What is the expected output of the following code?

Question58: What is the expected output of the following snippet?

Question59: The following expression
1+-2
is:

Question60: Which of the following statements are true? {Select two answers)

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

Question62: What independently inside the add_new () method in order to make the snippet's output equal to [0, 1, 1] ? (Select two answers)

Question63: Which of the following snippets will execute without raising any unhandled exceptions? (Select answers) A)

B)

C)

D)

Question64: Assuming that the following snippet has been successfully executed, which of the equations are True? (Select two answers)

Question65: With regards to the directory structure below, select the proper forms of the directives in order to import module_a. (Select two answers)

Question66: What is the expected output of the following snippet?

Question67: What is the expected behavior of the following snippet?

It will:

Question68: What is the expected behavior of the following code?

It will

Question69: What is true about Python class constructors? (Select two answers)

Question70: What is the expected output of the following code?

Question71: Which of the following statement are true? (Select two answers)

Question72: Which of the following lambda function definitions are correct? (Select two answers)

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