r/PythonLearning • u/SHBDemon • Sep 29 '25
Help Request What does invalid Syntax mean in this case?
The game is pretty simple. Bubbles spawn randomly, move around the screen and you have to collect them to gain score points. The code is from a 11 year old german book. Im pretty sure i did everything as it was written down but the order was pretty weird because it told me to code the definitions in a strange order just to change the order later. At this point its also the first time that i dont 100% understand what im actually coding.
4
u/VanillaMuffin97 Sep 29 '25
It would appear that where the x is marked red, in the hole_koord function you have typed retrurn instead of return, that might fix it already.
2
3
7
2
u/Can0pen3r Sep 29 '25
I'd recommend trying the IDE "Visual Studio Code" In many cases like this it can really help to isolate errors and show you exactly which line they occur on (in some cases even identifying the offending character or syntax error directly) so it is really useful for debugging.
1
1
u/bradleygh15 Sep 30 '25
...it means your syntax is wrong(in this case retrurn), imo id use a different editor then IDLE because it doesn't have the best linting
1
u/shinitakunai Sep 30 '25
Pycharm would help A LOT on these cases
1
u/PLSLEMMEEATTHATCAKE Sep 30 '25
And Pycharm has a community edition too so it's perfect for learning or little hobby projects like this
1
u/TheRNGuy Sep 30 '25
You can easily see bad syntax in VS Code or other code editors with red squiggles.
Which one are you using?
1
-1
34
u/TfGuy44 Sep 29 '25
You typed "retrurn", not "return".