+ 2
Python
How to make a list of combination of all the numbers from 1 to 128 keeping ' '. The output will be- '1,2','1,3','1,4'........
3 Answers
+ 2
Please, firstly show your attempt. After that ask what your problem is clearly. Thanks for understanding.
Happy coding!
+ 2
Sourya Banerjee ,
if you are allowed to use python library itertools you can use permutations.
[edited]:
as you have required the output as string, we can do it also with 2 nested for loops.
the output is a list containing strings with the numbers:
['1,2', '1,3', '1,4', '1,5', '1,6', '1,7', '1,8', '1,9', '2,1', '2,3', '2,4', '2,5', '2,6', '2,7', '2,8', '2,9', '3,1', '3,2', '3,4', ...]
+ 1
What should be the last output number ?