---
title: "Discussion on \"Python program to print the square of all elements in a list\" | Hashnode"
description: "Discussion on \"Python program to print the square of all elements in a list\". In this tutorial, we will learn How to square the elements of a list in Python. \nExplanation ✏\n\nFirst, create a list of n numbers\nThen, create another blank list for storing a square list \nNow, with the help of for loop append each number in the blan..."
url: "https://hashnode.com/posts/python-program-to-print-the-square-of-all-elements-in-a-list/60c248b2a25fa357af83e47f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Python program to print the square of all elements in a list](https://dx4iot.hashnode.dev/python-program-to-print-the-square-of-all-elements-in-a-list?utm_source=hashnode&utm_medium=feed)

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...

Jun 10, 2021 · 1 min read · dx4iot.hashnode.dev  
Read the article

-   [#2articles1week](https://hashnode.com/tag/2articles1week)
-   [#python](https://hashnode.com/tag/python)
-   [#python3](https://hashnode.com/tag/python3)
-   [#learn-coding](https://hashnode.com/tag/learn-coding)
-   [#python-beginner](https://hashnode.com/tag/python-beginner)

## Written by

[Nishant Tiwari](https://hashnode.com/@dx4iot)

@dx4iot · India

  
[View profile](https://hashnode.com/@dx4iot)

Pythonista | AI Enthusiast | Freelancer | Student

It has now been seven years since I am exploring my ways in the world of New Age technology. In all these years, what is my favourite thing in the whole world? I would say my keyboard! If it’s a war, I got my code as the skill and my keyboard as the weapon. When I was a kid, I wondered what it would feel like to be a hacker. I kept feeding my curiosity in the bits and pieces. I was getting introduced with new things everyday and over time. All this passion has made me targeted towards my main objective, that is, to learn everything which is out there about computer. For now, I have got a good grip over Python, JavaScript, C and C++. I think the main reason for my motivation is that I strongly believe, if you keep your mind clear and devote yourself to pure learning, there will come a time when your own reality will get surrounded by your self-made uniqueness.

## Responses 1

Markdown supported · ⌘↵ to post

[Siddharth Chandra](https://hashnode.com/@chandraji)

[Jun 11, 2021](https://hashnode.com/posts/python-program-to-print-the-square-of-all-elements-in-a-list/60c248b2a25fa357af83e47f/comment/60c30042a25fa357af83ee8f)

One more way is to use lazy evaluation:

map(lambda x: x\*x, num))

[Nishant Tiwari](https://hashnode.com/@dx4iot)

[Jun 11, 2021](https://hashnode.com/posts/python-program-to-print-the-square-of-all-elements-in-a-list/60c248b2a25fa357af83e47f/comment/60c30042a25fa357af83ee8f#reply-60c39c50a25fa357af840065)

yes correct 😃
