Analyze the following snippet and select the statement that best describes it.
The code is an example of implicitly chained exceptions.
The code is erroneous as the OwnMath class does not inherit from any Exception type class
The code is fine and the script execution is not interrupted by any exception.
The code is an example of explicitly chained exceptions.
If purple can be obtained from mixing red and blue, which color codes represent the two ingredients? Select two answers)
#FFFFFF
#0000FF
#FF0000
#000000
Select the true statements about the sqlite3 module. (Select two answers.)
The fetchalt method returns None when no rows are available
The execute method allows you to perform several queries at once
The execute method is provided by the Cursor class
The fetchone method returns None when no rows are available
A socket object is usually created by which one of the following invocations?
socket. socket (socket_domain, socket_type)
socket = socket. socket (socket_number)
socket = socket. socket (socket_domain, socket_type, server_address)
socket = socket.socket(server address)
Select the true statements related to PEP 8 programming recommendations for code writing. (Select two answers:)
You should use the not ... is operator (e.g. if not spam is None:), rather than the is not operator (e.g. if spam is not None:), to increase readability.
You should make object type comparisons using the ismstanceQ method (e.g. if isinstance (obj, int) :) instead of comparing types directly (eg if type(obj) is type(i)).
You should write code in a way that favors the CPython implementation over PyPy, Cython. and Jython.
You should not write string literals that rely on significant trailing whitespaces as they may be visually indistinguishable, and certain editors may trim them
Select the true statement about PEP 8 recommendations related to line breaks and binary operators.
It is recommended that you use line breaks before binary operators to improve code readability.
It is permissible to use line breaks before or after a binary operator as long as the convention is consistent locally However, for new code it is recommended that break lines should be used only after binary operators.
It is recommended that you use line breaks after binary operators to improve code readability.
There is no specific PEP 8 recommendation related to using line breaks with binary operators.
Select the true statement about the___name___attribute.
___name___is a special attribute, which is inherent for both classes and instances, and it contains information about the class to which a class instance belongs.
___name is a special attribute, which is inherent for both classes and instances, and it contains a dictionary of object attributes.
__name___is a special attribute, which is inherent for classes and it contains information about the class to which a class instance belongs.
__name___is a special attribute, which is inherent for classes, and it contains the name of a class.
Analyze the following snippet and choose the best statement that describes it.
self. name is the name of a class variable.
varl is the name of a global variable
Excalibur is the value passed to an instance variable
Weapon is the value passed to an instance variable
Analyze the code and choose the best statement that describes it.
___ne___() is not a built-in special method
The code is erroneous
The code is responsible for the support of the negation operator e.g. a = - a.
The code is responsible for the support of the inequality operator i.e. i =
Select the true statements about the sqirte3 module. (Select two answers.)
The sqlite3 module provides an interface compliant with the DB-API 2.0.
The special name memory is used to create a database in RAM.
The sqhte3 module does not support transactions.
The fetchall method returns an empty list when no rows are available