Which statement is used to create a new function in Python?
- class
- def
- import
- return
In Python, the def keyword is used to define and create a new function. This statement is followed by the function name and a block of code that defines the function's behavior.
Loading...
Related Quiz
- In Matplotlib, the ____ method is used to set the labels of the x-axis.
- In Python, the ____ method is used to get the number of elements in a set.
- How can you configure a Flask application to use an external configuration file?
- When designing a RESTful API, how should you handle versioning of the API?
- How would you create an instance of a metaclass in Python?