MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/pythonhelp/comments/kuoem8/help_what_am_i_doing_wrong/git4i4o/?context=9999
r/pythonhelp • u/tj260000 • Jan 10 '21
6 comments sorted by
View all comments
2
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!!!!!!
1
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!!!!!!
3
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!!!!!!
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!!!!!!
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!!!!!!
You were right!!!! It worked!!!!! Thank you so much!!!!!!
2
u/socal_nerdtastic Jan 10 '21
You need to indent everything in the function.