Why doesn't this work

Chris Angelico rosuav at gmail.com
Tue Sep 2 16:23:13 EDT 2014


On Wed, Sep 3, 2014 at 6:13 AM, Seymore4Head
<Seymore4Head at hotmail.invalid> wrote:
> I still can't get the syntax
> test='Hey buddy get away from my car'
> if test[0].alpha():
>     return True

If that's not in a function, "return" makes no sense, as the
SyntaxError will have told you. As to the actual check, that's
isalpha(), not alpha(), as you can see from the docs.

Suggestion: Choose subject lines that reflect the subject matter being
discussed. "Why doesn't this work" isn't very helpful. :)

ChrisA



More information about the Python-list mailing list