0 out of 464 challenges solved
Write a Python function `cube_nums(nums)` that takes a list of integers `nums` as input and returns a new list containing the cubes of each integer in the input list. #### Example Usage ```python [main.nopy] print(cube_nums([1, 2, 3, 4, 5])) # Output: [1, 8, 27, 64, 125] print(cube_nums([10, 20, 30])) # Output: [1000, 8000, 27000] print(cube_nums([12, 15])) # Output: [1728, 3375] ``` #### Constraints - The input list will only contain integers. - The function should return a new list without modifying the original input list.
def cube_nums(nums):
"""
Calculate the cube of each number in the input list.
Args:
nums (list): A list of integers.
Returns:
list: A list containing the cubes of the input integers.
"""
# Replace the following line with your implementation
pass