I am working with Python 2.7.12
I have the following list:
t = [1,2,3,4,5]
I want to have following output:
1+1, 1+2, 1+3, 1+4, 1+5, 2+2, 2+3, 2+4, 2+5, 3+3, 3+4, 3+5, 4+4, 4+5
I tried:
zip(t,t[1:])
but the output was:
[(1, 2), (2, 3), (3, 4), (4, 5)]
Then, I also tried:
zip(t,t)
but the output was:
[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]