Answer to Question #293089 in Python for JRR

Question #293089

Square to the Next Level


by CodeChum Admin



We've already tried printing out the values of an array in reversed order, right? Today, we shall compute for the squares of all the numbers.





There's already a predefined array/list containing 100 integer values. Loop through each values, compute their squares, and display them.



Output



Multiple lines containing an integer.



4


9


25


10000


49


9


25


9


1


16


.


.


.


1
Expert's answer
2022-02-02T06:10:47-0500
#creating an array of 100 random integers
from random import randint
arr = [randint(0,10) for _ in range(100)]
#calculation and display of the square of each array element
for num in arr:
	print(num*num)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS