I want to add the 1st element of each sublist with the values of another list
s1 = input()
s2 = input()
n1 = len(s1)
n2 = len(s2)
T = [[0]*n1]*n2
T[0] = list(range(n1))
for i in range(1,n2):
T[i][0] = i
print(T)
Output (comming):
[[0, 1, 2, 3, 4, 5], [5, 0, 0, 0, 0, 0], [5, 0, 0, 0, 0, 0], [5, 0, 0, 0, 0, 0], [5, 0, 0, 0, 0, 0], [5, 0, 0, 0, 0, 0]]
Output (want):
[[0, 1, 2, 3, 4, 5], [1, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [3, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0], [5, 0, 0, 0, 0, 0]]