r/pythonhelp • • Jan 10 '21

Help! What am I doing wrong?

Post image
2 Upvotes

6 comments sorted by

View all comments

2

u/socal_nerdtastic Jan 10 '21

You need to indent everything in the function.

1

u/tj260000 Jan 10 '21

So im not sure if I'm indenting correctly but if I am then it just says invalid syntax.

3

u/socal_nerdtastic Jan 10 '21

In that image you are not indenting it at all. You need to press the spacebar a couple times before every line in the function.

1

u/tj260000 Jan 10 '21

So I just did that and its still saying I have an invalid syntax in the last line.

2

u/socal_nerdtastic Jan 10 '21

Oh I see the code you are using is python2 code. I don't think you can run python2 with the python.org website. You'll need to go to repl.it or pythontutor.com or pythonanywhere.com and set it to python2 mode.

1

u/tj260000 Jan 10 '21

You were right!!!! It worked!!!!! Thank you so much!!!!!!