Product the elements with their index values



Problem to product the each and every element with their index value.



Example-1:


Input    : n = [ 5, 1, 4, 3]
Output   : [0, 1, 8, 9] 
Explain  : 5 * 0 = 0.
           1 * 1 = 1.
           4 * 2 = 8.
           3 * 3 = 9.  


Example-2:


Input    : n = [ 1, 3, 5, 7, 9]
Output   : [0, 3, 10, 21, 36] 
Explain  : 1 * 0 = 0.
           3 * 1 = 3.
           5 * 2 = 10.
           7 * 3 = 21. 
           9 * 4 = 36. 







Solution




n = [ 5, 1, 4, 3]

l = []

for i in range(len(n)):

    l.append(n[i]*i)

print(l)



Output



[0, 1, 8, 9]