To get all the keys from a Python dictionary, you can use the ____ method.

  • get()
  • items()
  • keys()
  • values()
To obtain all the keys from a Python dictionary, you should use the keys() method. This method returns a view object that displays a list of all the keys in the dictionary.

To represent a constant property in a Python class, you would typically use _____.

  • const
  • final
  • readonly
  • static
In Python, to represent a constant property in a class, you would typically use the readonly keyword. It ensures that the property cannot be modified after it's assigned a value.

The _____ method in a metaclass is executed when a new class is created.

  • class
  • init
  • metaclass
  • new
In Python, the __new__ method in a metaclass is executed when a new class is created. It allows you to customize the creation process of classes before __init__ is called.

The _____ method in Python is used to delete the object and perform the cleanup activities.

  • del
  • delete
  • destruct
  • finalize
In Python, the finalize method is used to perform cleanup activities and delete an object. This method is called automatically by the garbage collector before reclaiming the memory used by the object.

The algorithm that follows the 'divide and conquer' strategy is ____.

  • Binary Search
  • Bubble Sort
  • Merge Sort
  • Quick Sort
The algorithm that follows the 'divide and conquer' strategy is Quick Sort. In Quick Sort, the array is divided into smaller subarrays, sorted separately, and then combined.

The ____ algorithm is commonly used to dynamically optimize and solve overlapping subproblems.

  • Backtracking
  • Divide and Conquer
  • Dynamic Programming
  • Greedy
The Dynamic Programming algorithm is commonly used to dynamically optimize and solve overlapping subproblems. It stores the results of subproblems to avoid redundant computation.

The ____ algorithm is used to traverse all the vertices of a graph in depthward motion.

  • A*
  • Breadth-First Search (BFS)
  • Depth-First Search (DFS)
  • Dijkstra's
The Depth-First Search (DFS) algorithm is used to traverse all the vertices of a graph in a depthward motion. It explores as far as possible along each branch before backtracking.

The ____ attribute in a class is used to define its metaclass.

  • __class__
  • __init__
  • __meta__
  • __metaclass__
The __class__ attribute in a class is used to define its metaclass. It is assigned the metaclass when the class is defined.

The ____ attribute in a Matplotlib Axes object represents the y-axis.

  • get_yaxis
  • set_y
  • set_y_axis
  • y_axis
In Matplotlib, the get_yaxis attribute represents the y-axis of an Axes object. This attribute allows you to access and modify properties of the y-axis, such as tick locations and labels.

The ____ decorator is used to convert a function into a static method.

  • @classmethod
  • @classmethod
  • @staticmethod
  • @staticmethod()
In Python, the @staticmethod decorator is used to define a static method within a class. Static methods are methods that belong to a class rather than an instance and can be called on the class itself. They don't have access to the instance's state.