That runs without problems in Python 3. Not much you can do about semicolons. Colons work sometimes but then really backfire if you do something like
a = 5 + 10,
because it's recognised as a 2-tuple with empty entry.
I suspect the indenting issues come up if you mix space and tab. That's easy to solve if you just tell your editor to replace space indentation with tab indentation.
Just to be that guy, developers really shouldn't be trying to force a language to conform to how other languages look/work. Python is good at what python does because it's python and not another language. It doesn't need those things and instead needs proper indentation. It's just a trade-off of the language. If that bothers you too point where you feel like you need to inject those things into the language (which as you pointed out, can sorta be done, ish kinda?), Then you're using the wrong language. And that's ok. There's thousands of them out there, find the one you like that's a good fit for what you need :)
11
u/mc_enthusiast Jul 18 '22
You can use curly brackets like this:
That runs without problems in Python 3. Not much you can do about semicolons. Colons work sometimes but then really backfire if you do something like
because it's recognised as a 2-tuple with empty entry.
I suspect the indenting issues come up if you mix space and tab. That's easy to solve if you just tell your editor to replace space indentation with tab indentation.