Python Programming - Lists - Discussion

Discussion Forum : Lists - General Questions (Q.No. 55)
55.
How can you create a list of squared values from another list in Python?
squared_list = list.square_values()
squared_list = [x^2 for x in original_list]
squared_list = list.map(lambda x: x**2, original_list)
squared_list = [x**2 for x in original_list]
Answer: Option
Explanation:
Using list comprehension, you can create a new list of squared values from an existing list.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.