▸ Python (Programming Language) | LinkedIn Skill Assessment Quiz Solutions
-
What is an abstract class?
- An abstract class is the name for any class from which you can instantiate an object.
- Abstract classes must be redefined any time an object is instantiated from them.
- Abstract classes must inherit from concrete classes.
- An abstract class exists only so that other “concrete” classes can inherit from the abstract class.
-
What happens when you use the build-in function
any()
on a list?- The
any()
function will randomly return any item from the list. - The
any()
function returns True if any item in the list evaluates to True. Otherwise, it returns False. - The
any()
function takes as arguments the list to check inside, and the item to check for. If “any” of the items in the list match the item to check for, the function returns True. - The
any()
function returns a Boolean value that answers the question “Are there any items in this list?”
- The
-
What data structure does a binary tree degenerate to if it isn’t balanced properly?
- linked list
- queue
- set
- OrderedDict
-
What statement about static methods is true?
- Static methods are called static because they always return
None
. - Static methods can be bound to either a class or an instance of a class.
- Static methods serve mostly as utility methods or helper methods, since they can’t access or modify a class’s state.
- Static methods can access and modify the state of a class or an instance of a class.
- Static methods are called static because they always return
-
What are attributes?
- Attributes are long-form version of an
if/else
statement, used when testing for equality between objects. - Attributes are a way to hold data or describe a state for a class or an instance of a class.
- Attributes are strings that describe characteristics of a class.
- Function arguments are called “attributes” in the context of class methods and instance methods.
- Attributes are long-form version of an