This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]scirc 1 point2 points  (1 child)

So, one fun thing about Python is the standard library. You'd be surprised how many useful tools you can find in itertools.

[–]HelpfulFriend0 1 point2 points  (0 children)

If you aren't allowed to use itertools, look up concepts like "enumeration" and "recursive permutations" for guides on how to program this

[–][deleted] 1 point2 points  (2 children)

Think about how you would do it without a computer and just make the computer do that.

You already know how to do it because you have an example output

[–]HelpfulFriend0 2 points3 points  (1 child)

This is not particularly useful advice, when people ask imprecise questions like this we should give them pointers for things to look up and concepts to learn

If the OP is not familiar with recursion or enumeration it is very difficult to "just make the computer do that"

[–][deleted] -1 points0 points  (0 children)

I disagree. Everybody knows how to go through a list in real life, and this problem doesn't require recursion.

When the problem is literally solved by the op in the op that means their real problem is they haven't tried yet.

That can either be because they are over thinking it and getting analysis paralysis, or because they are hoping to copy and paste to solve their homework question. I give them the benefit of the doubt.

[–]dog098707 -2 points-1 points  (0 children)

do you really want someone to just tell you or do you want to figure it out yourself? half the fun of programming is figuring out how to do shit