Which keyword is used to define a function in Python?
- def
- define
- func
- function
In Python, the keyword 'def' is used to define a function. For example, 'def my_function():' defines a function named 'my_function.'
Loading...
Related Quiz
- You are asked to create a new column in a DataFrame that is the sum of two other columns. How would you create this new column in Pandas?
- How can you avoid hardcoding the URL in Django templates when using the anchor tag?
- In Python, which keyword is used to define a metaclass within a class definition?
- You are writing a nested function, and you want to modify a variable from the outer function. However, you don't want this change to affect the global scope. How can you achieve this?
- Which memory management technique does Python primarily utilize?