I mean, there is a lot wrong with it, but every language has its quirks. Generally I like discussing it’s actual flaws cause it helps me better understand the language.
- 0 Posts
- 9 Comments
Maybe I’m missing something, but:
- Python Lambda Functions - https://www.w3schools.com/python/python_lambda.asp
- Python map - https://www.geeksforgeeks.org/python-map-function/
- They do have list comprehension, which let you basically one line a map operation more intuitively too.
jacksilver@lemmy.worldto No Stupid Questions@lemmy.world•Why is having a lawyer present during police interviews "opt in" rather than "opt out"?2·7 days agoIm not sure I’d call cops expert interrogators, it’s more like they’re playing with a stacked deck.
jacksilver@lemmy.worldto Ask Lemmy@lemmy.world•What's the worst rated film that you love?1·9 days agoThe series had some great moments in it. Almost like a college version (more sophmoric) of It’s Always Sunny.
The movie though was pretty bad. Which was a shame given how good the last episodes of the series were.
While it isn’t apparent from looking at recent events, senators are actually some of the most powerful people in US politics. That’s because they are the smaller chamber of the US legislative branch.
Why I say they are powerful is that they (along with the house) dictate laws and the budget for the US. While the house, the larger chamber of the legislative, performs a similar role the house has 435 people vs the senate’s 100 (meaning the power of the senate is less diluted).
While looking at the current affairs in the US might seem to imply Trump is all powerful. Right now he is only able to do what he is doing becuase Republicans effectively control all three branches of the US federal government (legislative - makes laws, executive - executes laws, judicial - evaluates/interprets laws).
If they wanted to, the senate could stop a lot of what Trump is doing. If they had support of the house, they could literally kick him out of office. While the judiciary also has a lot of power, it’s more reactive rather than proactive when compared to the legislative.
So In summary a senator is one of the top law makers (as in literally defines the law) in the US. And if senate and house work together, they are the most powerful branch of the US government. The main issue is getting 635 people to agree on anything, which is why over the past couple decades the executive had been able to exert power power/influence in the US.
jacksilver@lemmy.worldto No Stupid Questions@lemmy.world•How does AI-based search engines know legit sources from BS ones ?2·13 days agoWhy is this downvoted?
It’s the right response, the top link is giving creditability through a ranking algorithm and is not guaranteed to have the right info. An LLM is trained on large corpus of (hopefully) quality data, but may not return the right information. Both may lead you to the wrong results and it’s always been the users responsibility to verify information.
The only major difference between search and an LLM is that the LLM believes it knows the answer and search just tells you “this is the most relevant thing I could find”.
jacksilver@lemmy.worldto Programmer Humor@programming.dev•Python needs an actual default function2·15 days agoIt is “built-in” as the name is part of python. However, Python runs top to bottom, rather than having a special entrypoint. So name is just a utility you can use in your design.
While it can be a good practice to define a main entrypoint, that’s more of a design decision and not hard rule. Many applications would not benefit from it because there is only one way to actually call the application to begin with.
Edit: Also not a dumb question. All programming languages have unique elements to them due to how they were envisioned and or developed over time (Pythons 30 years old)
jacksilver@lemmy.worldto Programmer Humor@programming.dev•Python needs an actual default function16·16 days agoThe point of the name==main logic is that it checks if that is the file that was invoked (like running
python filename.py
). If you just put a main() in the global scope it will be called either when the file is invoked or loaded (which can cause unintended consequences).
I think the idea is it reads more naturally, so you can read it like this
return A if statement is true else return B