1 hour in Java

Yeah but due to the extra indentation in the second image, the python party doesn’t work.
I don’t understand why people complain about their Python code breaking because it relies on indentation instead of explicit {} syntax. I’ve never had an issue with it and it’s not just because I’m used to it because Python is the only language I use that relies on whitespace like that. I think the complainers just don’t know how to indent properly, which makes me really glad they’re writing in a language that forces them to instead of pushing unreadable garbage in other languages.
I once wrote a bot in python tdownloaded a ical file, looked for chances and informed me if found. The space indentation made it hell to follow the code in my opinion.

What about spaces made it hard? What language would have been easier? In curly brace languages, 99% of the time, a curly brace is followed by a line break and an indent. Python is similar except it’s typically a colon, line break, then indent.

What I have learned is: If the code is indented too deeply, it’s a code problem, not the language.

Torvalds infamously wrote:

“… if you need more than 3 levels of indentation, you’re screwed anyway, and should fix your program.”

linux/Documentation/process/coding-style.rst at master · torvalds/linux

Linux kernel source tree. Contribute to torvalds/linux development by creating an account on GitHub.

GitHub
Torvalds wrote this about C. There’s plenty languages where it’s much more common and less of a complexity indicator to open up scopes.

Correct, I linked the source of the quote. My implication is the general idea is applicable here. Is python one of these languages where it is idiomatic to nest code deeply?

The Zen of Python:

Flat is better than nested.

From the python I have seen and written, deep nesting is avoided.

PEP 20 – The Zen of Python | peps.python.org

Long time Pythoneer Tim Peters succinctly channels the BDFL’s guiding principles for Python’s design into 20 aphorisms, only 19 of which have been written down.

Python Enhancement Proposals (PEPs)
Too much nested code was likely part of the problem, but not being able to easily tell where a block of coded ended without seeing the top of the block made it difficult to work with.
That’s fair! Takes time to get used to. Modern editors make this easier by highlighting the current indent level, or can even make the top X lines of the current closure “stick” to the top of the editor for those really long blocks.
Having those features would really have made it easier. I have only ever written my python code in Sublime Text. While it is a sublime text editor, at is not ideal (compared to how it is to write Java in IntelliJ) for Python. (Maybe with addons but I never delved into that more than a few.)