Input L1=[2,0,5,3,5]
output L2[4,0,10,6,10]
using for loop
Answers
Answered by
0
Answer:
L1 = [2,0,5,3,5]
L2 = []
for item in L1:
L2.append(2 * item)
print(L1)
print(L2)
Explanation:
Answered by
1
def mod_list(arr):
L2 = []
for n in arr:
L2 = [*L2, n * 2]
return L2
L1 = [2, 0, 5, 3, 5]
print(mod_list(L1))
Similar questions