#write a function add_one that has one parameter, one dimensional list #function adds 1 to each list element #no return value #Write main that randomly generates list of 10 integers, each integer #between -2 and 2. Program prints original list,calls the function, and #prints list after function execution #Example: #Suppose the original list is: -2 1 0 0 1 1 -1 2 0 1 #after function execution list is: -1 2 1 1 2 2 0 3 1 2 import random def add_one(my_list): size=len(my_list) for i in range(size): my_list[i]=my_list[i]+1 #no return value #you can write #return #but its not required def main(): my_list=[] for i in range(10): my_list.append(random.randint(-2,2)) print("original list") print(my_list) #function call add_one(my_list) #pay attention, you don't have any variable to do assignment #statement, since function doesn't have return value print("list values after function call") print(my_list) #one dimensional lists in Python are REFERENCE parameters #meaning: function can make changes to list elements #and these changes preserved after function execution is completed main()