Program - Create list of numbers using lambda function but not the right way


Topic: Program - Create list of numbers using lambda function but not the right way

Solution

my_list = [lambda: i for i in range(5)]
for l in my_list:
    print(l())



List all Python Programs