Computer Science, asked by rajibghoah9720, 3 months ago

Input L1=[2,0,5,3,5]
output L2[4,0,10,6,10]
using for loop

Answers

Answered by Anonymous
0

Answer:

L1 = [2,0,5,3,5]

L2 = []

for item in L1:

L2.append(2 * item)

print(L1)

print(L2)

Explanation:

Answered by jai696
1

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

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))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions