Answer to Question #298023 in Python for Kent

Question #298023

Input 10 numbers. Put it in a list. Turn every item of a list into its square. Print the result.


Expected output:

Enter Input 1

Enter Input 2

Enter Input 3

Enter Input 4

Enter Input 5

Enter Input 6

Enter Input 7

Enter Input 8

Enter Input 9

[1, 4, 9, 16, 25, 36, 49, 64, 81]

Note: the inputs are used for demonstration purposes only. Use yor own combination of inputs.


1
Expert's answer
2022-02-15T08:16:12-0500
from random import randint


a = [randint(1, 1000) for _ in range(10)]
for i in a:
    print(f'Enter Input {i}')

a = [i ** 2 for i in a]
print(a)

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