def add_2(x): x += 2 return x num_list = [1,2,3,4,5,6,7] print("original list is :",num_list) new_list = list(map(add_2,num_list)) print("modified list is:",new_list)
To embed this project on your website, copy the following code and paste it into your website's HTML: