I don't know... The best solution, of course... But I think it would be nice to try at least to improve your skills in creating algorithms. If there a module it's good. But sometimes there isnt
Ah, but this is part of the standard library, not a 3rd party framework. I think this makes all the difference in the world. Once we import a 3rd party framework, we also import the concept of dependency management and the many issues that accompany it. But standard library features are freebies.
For one, you don't need to send a link to your solution. There's a "View Solution" button under every commenter, which allows anyone to view the commenter's solution.
For another, your solution being more clever is definitely one of the possible opinions... doesn't make it true though.
LOL
Well... It does work and it might be the best practice to use the library function rather than invent the wheel. However it was supposed to be a challenge to find your own solution, wasn't it.
is there a difference between numpy prod and math prod?
well, it's indeed HIS more clever solution, so, it's true lol
I don't know... The best solution, of course... But I think it would be nice to try at least to improve your skills in creating algorithms. If there a module it's good. But sometimes there isnt
if it is provided, it shall be used when necessary
Ah, but this is part of the standard library, not a 3rd party framework. I think this makes all the difference in the world. Once we import a 3rd party framework, we also import the concept of dependency management and the many issues that accompany it. But standard library features are freebies.
Just when I thought my one-liner could not be beaten! This is the best solution because reusing a built-in capability is preferable to reinventing it.
For one, you don't need to send a link to your solution. There's a "View Solution" button under every commenter, which allows anyone to view the commenter's solution.
For another, your solution being more clever is definitely one of the possible opinions... doesn't make it true though.
This is clever, but not very interesting actually :\
Same. Well, might have been a holey 45 minutes.
I love the Python experience of trying to figure out bitwise operations for a solid 30 min and then seeing this as the top answer.
lmao
RTFM
This comment is hidden because it contains spoiler information about the solution
LOL
Well... It does work and it might be the best practice to use the library function rather than invent the wheel. However it was supposed to be a challenge to find your own solution, wasn't it.
Take a breath
Loading more items...