Q. What will be the output of the following code snippet?

Code:
square = lambda x: x ** 2
a = []
for i in range(5):
   a.append(square(i))
   
print(a)
  • (A) [0, 1, 4, 9, 16]
  • (B) [1, 4, 9, 16, 25]
  • (C) [0, 1, 2, 3, 4]
  • (D) [1, 2, 3, 4, 5]
πŸ’¬ Discuss
βœ… Correct Answer: (A) [0, 1, 4, 9, 16]

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
588
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Akash Lawaniya
Publisher
πŸ“ˆ
89%
Success Rate