Which one of the following lines properly starts a parameterless function definition?
- def fun():
- function fun():
- def fun:
- fun function():
Explanation: The correct way to declare a function in Python is to use the reserved keyword def followed by the name of the function, parentheses () and a colon ‘:’. Since it is parameterless, the parentheses are empty.
More Questions: Python Essentials 1 – Module 4 Test
Please login or Register to submit your answer