In Python, what keyword is used to define a new class?
- class
- def
- instance
- object
In Python, the keyword used to define a new class is 'class.' You use it to create a blueprint for objects with attributes and methods.
Loading...
Related Quiz
- You are given a list of words and you need to create a dictionary where keys are words and values are their respective lengths. Which Python construct will be most efficient for this?
- You are required to implement a Python function that needs to maintain its state between calls. Which Python feature would you use to achieve this?
- Sets in Python are _______ which means they cannot contain duplicate elements.
- In pytest, the ____ marker is used to skip a test function under certain conditions.
- Which feature of Python allows us to handle different numbers and types of arguments?