[Tutor] I have a problem with def

Mark Lawrence breamoreboy at gmail.com
Fri Feb 23 04:03:18 EST 2018


On 22/02/18 22:16, David Bauer wrote:
> it doesn't work, you are suppsed to declare a function as def func() and it
> comes back as:
> 
> File "<stdin>", line 1
>      def func()
>               ^
> SyntaxError: invalid syntax
> 
> that is not expected I would also expect def to turn red because it is a
> keyword in Python, but that doesn't happen, anyone else having this
> problem???? Anyone know what I should do or look for????

The colon is missing.

def func():
     ...
-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list