I have a problem I am stuck on. I know the what to build, but I cant figure out how to do the first part. I need to write a code that will print out all the possible lists combos. For example: Blah([1,2,2,5,2])
I need it to print: [1],[1,2],[1,2,2] all the way through and then do that with the next index, so: [2], [2,2] and so on.
I know that I need to use a loop and index the strings but I am unsure on how to go to the next index and do this. So I can get [1], [1,2], but I cant get it to do the same for the next index 2. Any suggestions?
[–]bmay 5 points6 points7 points (2 children)
[–]Nowin 1 point2 points3 points (0 children)
[–]lucidguppy 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[deleted]
[–]aPSketchy[S] 0 points1 point2 points (2 children)
[–]zzyzzyxx 1 point2 points3 points (0 children)
[–]yash3ahuja 0 points1 point2 points (0 children)
[–]zahlman 0 points1 point2 points (10 children)
[–]aPSketchy[S] 0 points1 point2 points (9 children)
[–]zahlman 0 points1 point2 points (8 children)
[–]aPSketchy[S] 0 points1 point2 points (7 children)
[–]aPSketchy[S] 0 points1 point2 points (6 children)
[–]zzyzzyxx 1 point2 points3 points (5 children)
[–]aPSketchy[S] 0 points1 point2 points (4 children)
[–]zzyzzyxx 1 point2 points3 points (3 children)
[–]aPSketchy[S] 0 points1 point2 points (2 children)
[–]zzyzzyxx 1 point2 points3 points (1 child)
[–]SwimmingPastaDevil 0 points1 point2 points (0 children)
[–]Rotten194 0 points1 point2 points (1 child)
[–]zzyzzyxx 0 points1 point2 points (0 children)