• 0 Posts
  • 247 Comments
Joined 2 years ago
cake
Cake day: July 3rd, 2023

help-circle












  • Edit… I reread your comment and realized that python does it differently and that everything I typed was irrelevant… I’m still gonna leave it if anyone is interested in ternary expressions, but I suppose the answer to your question is, that’s just how python does it.

    That’s how ternary operators are designed to work. In essence, if you’re looking to do a single line if/then, you can directly assign a variable from the result of a ternary expression.

    As an example, I was scripting something earlier where there may or may not be a value returned from a function, but I still had to do something with that return value later. For this thing, I was using JavaScript.

    I ended up with:

    return platform == "name"  ? "Option 1" : "Option 2"
    

    If I were to write that out in a typical if/then it would be:

    if (platform == "name") {
        return "option 1"
    } else {
        return "option 2"
    }
    
    

    A ternary starts with a boolean expression, then the if true value, else the false value. That’s returned to either a variable or if in a function like my example, to the object calling the function. It’s just a way to write less code that in many cases is easier to read.



  • I agree with you on everything you wrote.

    I’m not trying to say that Harris would have been good for Palestine, or even a good POTUS. I’m saying she was the less bad option overall in the election. I don’t know that anything would be different with Israel had she won, but I think there was a better chance that she would have done something good over Trump doing something good. That could still be a negligible chance, but it was the better of two chances.

    Like you said, local elections and primaries (when they’re held, but that’s separate from this overall conversation) are when to vote for different parties and more fringe candidates. One of two people is already the winner in the election by the time November rolls around, so it comes down to least bad.





  • All, unfortunately, true.

    Edit: Unfortunate for us in the US, not necessarily unfortunate for the rest of the world in some aspects. I still think as a whole his influence and other actions probably still make him worse for the world, but there is a valid argument about nations growing less dependent on the US.

    Hopefully in 3.5 years (or please God, less), the US will be knocked down a peg on the world stage, other nations have a more diverse and stable trade relationships, and maybe Trump’s actions will help spark other countries into action against hard right politics to prevent the same thing from happening to them. Ideally, this could be a catalyst for positive change, but I’m not holding my breath.