Skip to content
← Back to Community
SOLVED: Why does this say it's invalid syntax?
Profile icon
JAGMAN248

I'm not sure why this is giving me this error. It appears that it should work but doesn't. Here's the link https://repl.it/@JAGMAN248/Roll-the-Dice. Thanks for your help!

Voters
Profile icon
KkabirBHALLA
Profile icon
KateLeonard
Profile icon
RiyadhAbedin
Profile icon
EduardoGadelha
Profile icon
N416434
Profile icon
XzaraMiller
Profile icon
brandonkk0405
Profile icon
OngBrandon
Profile icon
nate8
Profile icon
LuanRykheer
Comments
hotnewtop
Profile icon
JAGMAN248

Yeah it works now.

Profile icon
ArchieMaclean
Profile icon
21natzil

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.

Profile icon
TrestynStalling

i need help on this i cant get all me indents righthttps://repl.it/@TrestynStalling/Debugger-if-Else-1

Profile icon
ArchieMaclean

Does it work now?

Profile icon
DuncanMorton

HOW TF DO U GAY

Profile icon
TheresaWolf

I’m asking a question, and I’ve added the answer == input thing,
But now I wanted to add
Else:
So that I could give a different answer, this has worked with all of my other codes, but for some reason it isn’t working now, it says that I have an invalid syntax but I don’t know how to fix that! If anyone could help then that would be great, thx

Profile icon
theangryepicbanana

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

Profile icon
ArchieMaclean

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

Profile icon
ArchieMaclean

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

Profile icon
JAGMAN248

Ah, thanks so much!

Profile icon
ArchieMaclean

on the line before you need to close the parentheses

Profile icon
ArchieMaclean

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