73.3k views
3 votes
Python program which squares all the number in list number = [2,3,4,5,6,7,8,9] and store it in another list name square. Please write a program :|

1 Answer

4 votes

Answer:

l = [2,3,4,5,6,7,8,9]

def solve(l):

for i in l:

print(i**2)

solve(l)

Step-by-step explanation:

loops through each element of the list and squares it.

User Bob Haslett
by
5.9k points