QuestionQ205

VerifiedFunctions and Exceptions

Which of the following lines correctly begins the definition of a function with no parameters?

Explanation

Python defines functions with def, a function name, parentheses containing the parameter list, and a trailing colon. A parameterless function still requires empty parentheses: def fun():.

Community Discussion

No comments yet. Be the first to start the discussion!