How Can I Create a List Comprehension

A list comprehension in Python is a way of writing condensed code to execute a function on every item in a list.

If we want to find the square of a number of a list.

We use the following code :

- First method

- Second method