Ask coding questions

← Back to all posts
SOLVED: Why does this say it's invalid syntax?
JAGMAN248 (25)

I'm not sure why this is giving me this error. It appears that it should work but doesn't. Here's the link Thanks for your help!

21natzil (1199)

On line 66, you forgot to end it with a second ). Tip: If you can't find the issue with the current line in syntax errors, look at the couple of lines before it.

theangryepicbanana (1697)

you need an else statement for the previous if/elif chain. I'd also recommend doing gold += bet * 2 instead of gold = gold + bet * 2

ArchieMaclean (928)

@theangryepicbanana that wasn't the reason for the syntax error though

ArchieMaclean (928)

Also later on you have some lines like
dialog("You won 5x your bet!") :
which is wrong (shouldn't have colon)

JAGMAN248 (25)

Ah, thanks so much!

ArchieMaclean (928)

on the line before you need to close the parentheses

ArchieMaclean (928)

@ArchieMaclean dialog("The roll was " + str(roll))
you missed the final closing parenthesis