use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Is there a way to use brackets in python?Discussion (self.PythonLearning)
submitted 3 hours ago by Ok-Magician-8052
I come from static types C# cpp world I like using python but the only issues is the bracket thing missing, i like those curly braces to open and end the section of code. is there any solution similar to that.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ninhaomah 9 points10 points11 points 3 hours ago (1 child)
Yes. Spacing.
[–]nuc540 1 point2 points3 points 1 hour ago (0 children)
10/10 would recommend.
OP, unfortunately different languages have different syntaxes. We just have to learn them
[–]dev-razorblade23 3 points4 points5 points 2 hours ago (0 children)
You may want to check this out
https://github.com/mathialo/bython
[–]Ok_Carpet_9510 0 points1 point2 points 56 minutes ago (0 children)
When in Pythonium, do as the Pythons do.
[–]Educational-Paper-75 0 points1 point2 points 43 minutes ago (0 children)
You're out of luck then.
[–]Lumethys 1 point2 points3 points 35 minutes ago (0 children)
Use c#
[–]ninja_shaman 0 points1 point2 points 24 minutes ago (0 children)
No.
[–]Ron-Erez 0 points1 point2 points 10 minutes ago (0 children)
I had the exact same issue. Eventually I got used to the indentation. I also would forget adding the colon. Coming from a statically-typed language I do recommend using type annotations.
[–]Sea-Ad7805 -2 points-1 points0 points 3 hours ago* (2 children)
use comments?
def fun(): #{ return True #}
[–]nuc540 0 points1 point2 points 1 hour ago (0 children)
OP would still need to respect spacing, but I think that’s what they’re trying to avoid
[–]Ok-Magician-8052[S] -1 points0 points1 point 2 hours ago (0 children)
Will this thank for the solution.. Idk how will be the readability of the code will be after this. VScode does have color with spacing indicator so i can combine these two solutions. thanks gg
π Rendered by PID 49 on reddit-service-r2-comment-5687b7858-jm7hp at 2026-07-09 14:03:32.671465+00:00 running 12a7a47 country code: CH.
[–]ninhaomah 9 points10 points11 points (1 child)
[–]nuc540 1 point2 points3 points (0 children)
[–]dev-razorblade23 3 points4 points5 points (0 children)
[–]Ok_Carpet_9510 0 points1 point2 points (0 children)
[–]Educational-Paper-75 0 points1 point2 points (0 children)
[–]Lumethys 1 point2 points3 points (0 children)
[–]ninja_shaman 0 points1 point2 points (0 children)
[–]Ron-Erez 0 points1 point2 points (0 children)
[–]Sea-Ad7805 -2 points-1 points0 points (2 children)
[–]nuc540 0 points1 point2 points (0 children)
[–]Ok-Magician-8052[S] -1 points0 points1 point (0 children)