Ask coding questions

← Back to all posts
Issues concerning running a python file
Criseist (0)

I just started a new project to mess around a bit and found something odd. I'm getting thrown a syntax error from this code:

if __name__ == "__main__":

Now, unless I'm blind, I don't see any issues with this code. I've checked outside sources, including python itself, and have found the same statement written over and over again. Furthermore, this line of code works with my other repl's. I have tried copy/paste and the error persists.

Has anyone had the same or similar issue? Am I just stupid? Any help would be greatly appreciated!

Edit: Fixing markup

Answered by malvoliothegood (432) [earned 5 cycles]
View Answer
malvoliothegood (432)

The problem was elsewhere. You are missing a closing bracket here: active = str(input("y/n:")

Criseist (0)

@malvoliothegood Thanks, that fixed it! Wondering why the error message referenced a different line then.