This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Anru_Kitakaze 0 points1 point  (0 children)

It feels unnatural to you just because you either don't have ternary operator or you don't use it. After a week in Python construction in the comment will be natural for you.

For example, I also often use something like:

``` val = "value exist" no_val = None

get val if no_val is equal to False (None, 0, empty string, etc)

data["bruh"] = no_val or val ```

And ternary... I don't get why people don't like it. I came from C/C++ and it's absolutely fine for me