lambda.py
l = ['Mon','Tue','wed']
def change_words(words, func):
for word in words:
print(func(word))
#If you don't use a lambda expression
#def sample_func(word):
#return word.capitalize()
#change_words(l,sample_func)
#You can write in one line using a lambda expression
change_words(l,lambda word:word.capitalize())
output:
Mon
Tue
Wed