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

_____, which are generated by web server software, record a user's actions on a web site. viruses log files junk e-mails worms
How life existed in India 4000 years back?
the sum of the ages of josh and autumn is 88 years 9 years ago josh was 4 times autumn age how old is josh now
Materials used in "additive" sculpture include:
Name 10 non Democratic countries except Saudi Arabia north Korea Jordan and China
The slope of line XY is 1/8, and XY ⊥ AB What is the slope of AB -8 -1/8 1/8 8
Wayne has a recipe on 3 inch by 5 inch index card that he wants to enlarge to 15 inches long. how wide will the enlargements be?
The correct number of significant figures in the number 1.250100 is:
Which line best creates a calm and peaceful mood? Enjoying the warmth of the sun, we ate our picnic next to the gently moving stream. The children ran through
which graph represents the solution set for the quadratic inequality x^2+2x+1 0