134k views
1 vote
You are given with a list of integer elements. Make a new list which will store square of elements of previous list. How can I do this on Python

1 Answer

5 votes

We declare our lst variable with a list of different integers.

We then use list comprehensions to create a list of all of the elements in our lst variable squared. We print the new list to the console.

You are given with a list of integer elements. Make a new list which will store square-example-1
User Eliot Sykes
by
5.3k points