I would like to write something like this
S = [ 0, 1, 2 ]
F = [ S.without(i) for i in range(0,len(S)) ]
print F
and Python putting out
[ [0,1], [0,2] ,[1,2] ]
and have not found something like this in the online reference. Can you help me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you don’t need the elements to be in any order — that is, if you can use sets — and if you want to remove items by value rather than by index, then this is a more elegant solution: