To know about the list comprehension
concept in python3.
As list comprehension returns list, theyconsists of brackets containing the expression which needs to be executed for eachelement along with the for loop to iterate over each element.
List comprehensions are used forcreating new list from another iterables.
[expression for loop one_or_more conditions]
print(“old list is\n”,list1)
new_list1=[i*i for i in list1]
#printing new list
print(“New list is”)