Okay, here is another freebie :) I will put in a real one before the end of the weekend.

Basically, you are given a list from which you need to create a new list where each element is the product of all the "OTHER" elements.

I found a few interesting corner cases.

I challenge you to give it a try!

Read the challenge here:

git.qoto.org/Absinthe/productn

My attempt is checked into that repo as well.

Follow

@Absinthe how do you feel about importing modules for these challenges? One standard lib module would make the no-division part really elegant.

@zingbretsen personally, I don't care. The "freebies" are ones I have found that were given as job interview exercises (so far).

Personally, I am working on buffing up my personal python skills, so I am trying to import as little as possible. So far I have needed only the random import for setting up data.

But you need to decide what you want to get out of these challenges. If importing libraries works for you I don't see anything much wrong with it. Unless the challenge is about the functionality that you want to import. For example. if the challenge was to write a bubblesort, obviously importing someone else's bubblesort library would be pretty much cheating.

@Absinthe That sounds very fair. I'll submit am example using a `deque` later today!

@Absinthe I will remember to do so when I post my solution 🙃

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.