Ask coding questions

← Back to all posts
Weird syntax error
20rduncan (11)

I keep getting this syntax error on my program and I don't know what it means:
SyntaxError: Unexpected token, expected ; (5:17)
Can anyone help me out?

Answered by pyelias (918) [earned 5 cycles]
View Answer
Commentshotnewtop
pyelias (918)

else shouldn't be followed by a condition (like (age < 21)). Just use else { ... }

20rduncan (11)

Oh! Okay, I'll fix that. Thanks for the help!