bananaa22 bananaa22
  • 26-02-2021
  • Computers and Technology
contestada

Given a list of numbers, use a while loop to print the square of each element in python.
Start of with: list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
ILL GIVE 50 POINTSSS

Respuesta :

Ultrabeast5121
Ultrabeast5121 Ultrabeast5121
  • 26-02-2021

Answer:

list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

counter = 0

lenlist = len(list) - 1

while counter < lenlist :

num = list [lenlist]

squ = num * num

print (squ)

counter += 1

Explanation:

as it goes through the list, it takes the element with that index and squares it, printing the squared number. it then increments the counter and starts again with the next element in the list.

Answer Link

Otras preguntas

Solve the formula c=pid for d
Search and find 5 applications of Neutralisation reaction and draw a mind map for the same.
what should we do for the betterment of all the living creature​
Is the atmosphere seen on the planet mars?
Construct the fourth proportional between a, b, and c.
4(m - 2) = -2(3m + 3)
For what reason did the Nazis work hard to keep Jewish prisoners in the ghetto from knowing what would take place at the end of their journey? The prisoners wou
x=[ ? ]° PLEASE HELP I WILL BE MAKING MULTIPLE POST
[tex](4x + 8) = ...........(x + ............)[/tex]Some one help me please ​
Consider the polynomial g(x) = 4x³ - x2 - 24x+6 a. List all possible rational zeros of the polynomial. (Assume all numbers shown are both + and -). O1, 2, 4, 1/