r/PythonLearning • • Jun 07 '25

Invalid syntax, doesn't matter what I do

I keep getting the same error.

Mach response.status_code:

                  ^

SyntaxError: invalid syntax

This is from a project I found on YouTube, at some point after trying to fix it for like 30 minutes I straight up copy-pasted the entire code from the YouTube channel onto PyCharm, no changes no nothing , and it still gave the exact same error. I'm totally lost right now.

0 Upvotes

31 comments sorted by

View all comments

Show parent comments

1

u/CptMisterNibbles Jun 07 '25

Dude,. how hard is it to post the entire error? Copy and paste it if you want help

2

u/All_Hale_sqwidward Jun 07 '25

C:\Users\pro\PycharmProjects\pythonProject\venv\Scripts\python.exe C:\Users\pro\PycharmProjects\pythonProject\main.py File "C:\Users\pro\PycharmProjects\pythonProject\main.py", line 89

match response.status_code: ^ SyntaxError: invalid syntax

Process finished with exit code 1

1

u/CptMisterNibbles Jun 07 '25

Great... Now I realize you intentionally cropped out the line numbers. Im not counting this shit out.

If you want help, maybe dont go out of your way to exclude information that is needed to actually help you.

Is it maybe the line where for your api key you havent actually put in an api key and instead have a string that says "YOUR API KEY GOES HERE"?

1

u/failaip12 Jun 07 '25

Is it maybe the line where for your api key you havent actually put in an api key and instead have a string that says "YOUR API KEY GOES HERE"?

But that won't cause the syntax error.

1

u/CptMisterNibbles Jun 07 '25

Probably true. Ive barely looked for an issue as OP is weirdly evasive about providing the tools to do so.

1

u/All_Hale_sqwidward Jun 07 '25

Lol, evasive? I literally didn't notice it when I took the pictures, and I can't edit the post. If I could've, I would've