Там же прям написано в виде комментов что такое функционально решение:
# 1st question
items = ["lawyer", "attorney", "prosecutor"]
new_list = []
for i in items:
i = i + " is related to legal affairs"
new_list.append(i)
print(new_list)
#functional solution = use map
functional solution = use map
Используем
map:
items = ["lawyer", "attorney", "prosecutor"]
new_list = list(map(lambda x: x + " is related to legal affairs", items))
print(new_list)
Во втором примере написано про
reduce, а в третьем про
filter