Defining and Calling Functions
Defining and Calling Functions. You might run into invalid syntax in Python when you’re defining or calling functions. For example, you’ll see a
SyntaxError if you use a semicolon instead of a colon at the end of a function definition, as seen here.
00:18 The traceback here is very helpful, with the caret pointing right to the problem character. You can quickly clear up this invalid syntax by switching out the semicolon for a colon. Speaking personally, my most common error is omitting the colon completely,
Become a Member to join the conversation.