What is the expected output of the following snippet?
What is the expected output of the following snippet? A. True False B. True True C. False False D. False True
What is the expected output of the following snippet? A. True False B. True True C. False False D. False True
You are going to read 16 bytes from a binary file into a bytearray called data. Which lines would you use? (Select two answers) A. data = bytearray (16) bf.readinto (data) B. data = binfile.read (bytearray (16)) C. bf. readinto…
If S is a stream open for reading, what do you expect from the following invocation? A. one line of the file will be read and stored in the string called C B. the whole file content will be read…
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? A. print…
If any of a class’s components has a name that starts with two underscores (___), then: A. the class component’s name will be mangled B. the class component has to be an instance variable C. the class component has to…
What is the expected behavior of the following code? It will: A. print 0 B. cause a runtime exception C. prints 3 D. print an empty line
If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write: A. except Ex1 Ex2: B. except (ex1, Ex2): C. except Ex1, Ex2: D. except Ex1+Ex2:
A function called issubclass (c1, c2) is able to check if: A. c1 and c2 are both subclasses of the same superclass B. c2 is a subclass of c1 C. c1 is a subclass of c2 D. c1 and c2…
A class constructor (Select two answers) A. can return a value B. cannot be invoked directly from inside the class C. can be invoked directly from any of the subclasses D. can be invoked directly from any of the superclasses
What is the expected output of the following code? A. 2 B. The code will cause a runtime exception C. 1 D. 3