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

Imagine everyone in the United States exhibited the character traits we have been discussing. In what ways would America be different? Now imagine no one in Ame
Jayden walks home from school. At the midpoint M, he buys a soda.If s (-2,-3) is the school and the midpoint Mis (2, 2), where is home H?
Helllp me pls! I need help with this question “use this graph to complete the following statements “
In general, what were the national goals of the five “Great Powers”?
Evaluate. 4^3 x 4^7 (4^2)^6
Find the sum of 31 + 32 +33 + ... + 230.
There are 12 inches in 1 foot. Use a proportion to covert 12 feet into inches.
can someone help on number 7 and 8 show work please aswell this is due tmr!
The weight of the of an object to is equal to 3/4 of its own weight plus 3/4 of a pound. How much does the object weigh? Explain.
XII. Complete the second sentence so that it means the same as the first. 1. My family has four people.  There ________________________________________________