+ 1

Does anyone know how to never make syntax error in python code

i've been trying to code this snake game but it's awfully hard cause i keep on getting syntax error

7th Sep 2018, 2:02 PM
wade tyson
wade tyson - avatar
4 Antworten
+ 3
Depending on the IDE syntax errors are highlighted. In general, the more experience you gain, the less syntax errors you will make (or at least find them quicker 😉)
7th Sep 2018, 2:10 PM
Matthias
Matthias - avatar
+ 3
I started using pylint. It helps an incredible lot! Just run "pylint <File>", and it shows syntax and style errors. My code got incomparably better.
22nd Sep 2020, 6:51 PM
Emerson Prado
Emerson Prado - avatar
+ 2
Check for errors frequently - for each few lines changed. There's no way of not making mistakes. But catching them early makes it easy to know where they are and how to fix them.
7th Sep 2018, 2:28 PM
Emerson Prado
Emerson Prado - avatar
+ 1
When the interpreter comes to a syntax error, it writes you the number of line where it happened. So look at that line (or around), try to find what's wrong and run again.
7th Sep 2018, 2:51 PM
michal