Search inside dynamic array in python

Posted by user2091683 on Stack Overflow See other posts from Stack Overflow or by user2091683
Published on 2013-06-29T16:14:31Z Indexed on 2013/06/29 16:21 UTC
Read the original article Hit count: 131

Filed under:
|

I want to implement a code that loops inside an array that its size is set by the user that means that the size isn't constant.

for example: A=[1,2,3,4,5] then I want the output to be like this:

[1],[2],[3],[4],[5]
[1,2],[1,3],[1,4],[1,5]
[2,3],[2,4],[2,5]
[3,4],[3,5]
[4,5]
[1,2,3],[1,2,4],[1,2,5]
[1,3,4],[1,3,5]
and so on
[1,2,3,4],[1,2,3,5]
[2,3,4,5]
[1,2,3,4,5]

Can you help me implement this code?

© Stack Overflow or respective owner

Related posts about python

Related posts about algorithm