I'm a newbie to python and I am having a very hard time trying to solve a homework question that I have. Here it is:
Given a list of items, write a program that generates a list of lists of the following form: [a,b,c,…,z] → [[z], [y,z], [x,y,z], … , [a,b,…,y,z]]
I know that I have to use slicing and I even thought list comprehension may be a good way to solve, but I can not up with the syntax. I tried a for loop, but I think this problem can be solve with out it. Any help would be appreciated.