4. Assume you have a list of numbers
12,10,32,3,66,17,42,99,20
a) Write a loop that prints each of the numbers on a new line.
b) Write a loop that prints each number and its square on a new line.

Respuesta :

lst = [12,10,32,3,66,17,42,99,20]

a)

for x in lst:

   print(x)

b)

for x in lst:

   print(str(x) + " " +str(x**2))

I think this is what you're looking for. Hope this helps!

ACCESS MORE