Coding basics · 19 of 20
Square every number
Return a new list with each number squared, in the same order.
Examples
Input nums = [1, 2, 3]
Output [1, 4, 9]
Input nums = [-4, 0, 5]
Output [16, 0, 25]
Coding basics · 19 of 20
Return a new list with each number squared, in the same order.
Input nums = [1, 2, 3]
Output [1, 4, 9]
Input nums = [-4, 0, 5]
Output [16, 0, 25]