In this tutorial, we will learn How to square the elements of a list in Python. Explanation ✏ First, create a list of n numbers Then, create another blank list for storing a square list Now, with the help of for loop append each number in the blan...

Markdown supported · ⌘↵ to post
Siddharth Chandra
Senior Software Engineer
One more way is to use lazy evaluation:
map(lambda x: x*x, num))