▲ 150 ▼ proportional reaction (lemmy.blahaj.zone) submitted 11 months ago by guber@lemmy.blahaj.zone to c/lemmyshitpost@lemmy.world 45 comments fedilink hide all child comments
[–] four@lemmy.zip 1 point 11 months ago (2 children) What I like about using if and else for that is that you're already using those keywords for branching in other parts of the code. Though my least favorite is probably Python's: x = "foo" if y > 5 else "bar" It just seems backwards to me permalink fedilink source parent hideshow 4 child comments replies: [–] thebestaquaman@lemmy.world 1 point 11 months ago* (1 child) While Python's version does feel a bit backwards, it's at least consistent with how list comprehensions are set up. They can also feel a bit "backwards" imo, especially when they include conditionals. permalink fedilink source parent hideshow 2 child comments replies: [–] four@lemmy.zip 1 point 11 months ago (1 child) List comprehension is another thing I don't like about Python :) There's more of those, but one thing I do like about Python is that I get paid for writing it, so I try not to complain too much permalink fedilink source parent hideshow 2 child comments replies: [–] kryptonianCodeMonkey@lemmy.world 3 points 11 months ago I love list comprehension. Best part of the language, imo. To each their own. permalink fedilink source parent [–] UnfortunateShort@lemmy.world 1 point 11 months ago* Because Python wants you to read it like English: x is "foo" if y is greater than 5, else it is "bar" permalink fedilink source parent
[–] thebestaquaman@lemmy.world 1 point 11 months ago* (1 child) While Python's version does feel a bit backwards, it's at least consistent with how list comprehensions are set up. They can also feel a bit "backwards" imo, especially when they include conditionals. permalink fedilink source parent hideshow 2 child comments replies: [–] four@lemmy.zip 1 point 11 months ago (1 child) List comprehension is another thing I don't like about Python :) There's more of those, but one thing I do like about Python is that I get paid for writing it, so I try not to complain too much permalink fedilink source parent hideshow 2 child comments replies: [–] kryptonianCodeMonkey@lemmy.world 3 points 11 months ago I love list comprehension. Best part of the language, imo. To each their own. permalink fedilink source parent
[–] four@lemmy.zip 1 point 11 months ago (1 child) List comprehension is another thing I don't like about Python :) There's more of those, but one thing I do like about Python is that I get paid for writing it, so I try not to complain too much permalink fedilink source parent hideshow 2 child comments replies: [–] kryptonianCodeMonkey@lemmy.world 3 points 11 months ago I love list comprehension. Best part of the language, imo. To each their own. permalink fedilink source parent
[–] kryptonianCodeMonkey@lemmy.world 3 points 11 months ago I love list comprehension. Best part of the language, imo. To each their own. permalink fedilink source parent
[–] UnfortunateShort@lemmy.world 1 point 11 months ago* Because Python wants you to read it like English: x is "foo" if y is greater than 5, else it is "bar" permalink fedilink source parent