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

A marathon runner took 3 hours and 15 minutes to finish a 26-mile marathon. What was his average time in minutes per mile to run the race?
what is -(m+5n-8) simplified
if the first two terms of a geometric sequence are a1=216 and a2=72 then which of the following is the third term, a3=? Explain how you did it please 1)648 2)2
A rectangle with an area of 4/7 m? is dilated by a factor of seven. What is the area of the dilated rectangle?
Bob invests $11726 in an account that pays 7.44% interest per year for 2 years. How much simple interest will he earn? Round your answer to the nearest penny if
HELP OOF decide whether the sentence is grammatically correct or incorrect as written. nosotros viajaste a Perú.
Describe your DNA model. Which part do the straws represent? The pushpins? The paper clips and the black dots you made with the marker?
NEED HELP ASAAAPPP PLEASEE IM GOING TO DIEE
What is the solution to the linear system of equations?​
What’s the answer to my problem