Robotics & Artificial Intelligence
Write a Python program to generate the square of all the elements of a list.
Python List Manipulation
2 Likes
Answer
numbers = [2, 3, 4, 5, 7]
for i in numbers:
print(i * i)Output
4
9
16
25
49
Answered By
1 Like
Related Questions
Write a Python program to convert a tuple into a list and a list into a tuple.
Write a Python program to search an element in the list.
Write a Python program to add all the elements of the list.
Write a program in Python to create a list of your classmates containing their names and roll numbers. Access the roll number of the student whose name is stored at 2nd index.