Consider the following Python code:
numbers = [1, 2, 3, 4, 5]
# square each number in the list
for i in range(len(numbers)):
numbers[i] = numbers[i] ** 2
# print the squared numbers
for num in numbers:
print(num)
How can this code be transformed into a functional program?