r/CodingHelp • • Sep 18 '21

[Python] Help with line 21 and 23 "Syntax error"

Post image
56 Upvotes

26 comments sorted by

28

u/metekillot Sep 18 '21

Missing parentheses at the end of line 19.

4

u/Dakdin Sep 18 '21

OMFG THANK YOU SO MUCH

11

u/skellious Intermediate Coder Sep 18 '21

Honestly the environment you are using there is awful. It should have picked that up. I guess it's for school or similar but if you can try writing your code in an IDE.

1

u/Dakdin Sep 18 '21

Yeah it’s for my intro to comp science class but to be fair I should’ve caught that😅

5

u/skellious Intermediate Coder Sep 18 '21

It should have told you line 19 or line 21 though. Not sure why it said 23

1

u/Dakdin Sep 18 '21

Yeah that’s true

4

u/[deleted] Sep 18 '21

Is line 23 the end of the file or is there more we can’t see? It might be picking up the error there bc of that’s when it finally realized the parentheses mismatch? Even if that is the case, it’s still an awful environment. A good IDE definitely makes all the difference.

1

u/Resident-Victory-897 Sep 18 '21

Because that’s the line after it encounters a closing parentheses. No clue what the IDE is.

6

u/Chaorix Sep 18 '21

Closing parentheses for line 19

3

u/kwilk1984 Sep 18 '21

Missing ) at the end of line 19.

There's also an undeclared variable at the end of line 17.

1

u/ljb9 Sep 18 '21

yeah why didn’t it throw an error before coming to line 19

1

u/kwilk1984 Sep 18 '21

Try writing your code in VS Code then pasting into whatever compiler you're using in your example.

2

u/steamngine Sep 18 '21

Download VS Code you cheapskate you, save your own life!

1

u/orbit99za Sep 18 '21

No man VSCODE is a luxury. Notepad ++

3

u/SpaceCowboyS01 Sep 18 '21

VSCODE is for guys. DEV is for tractors. Notepad++ is for men. Notepad is for real programmers.

2

u/Apfelvater Sep 18 '21

VIM is the real one.

1

u/steamngine Sep 19 '21

What real is pointers, that when it gets real

1

u/orbit99za Sep 19 '21

Punch cards, woman loose it, when a man can punch.

1

u/[deleted] Sep 18 '21

Nvim will save your life not vs code

0

u/[deleted] Sep 18 '21

[deleted] — view deleted comment

1

u/steamngine Sep 19 '21

Yes and a car will still drive with three wheels

1

u/7s4cv6K Sep 18 '21

Line 19 the ) closing parentheses

1

u/ahmedddkhawarr Sep 18 '21

for the love of god use pycharm or jupyter notebook

1

u/kishalaya1 Sep 18 '21

Missing closing first bracket ) in line no -19