You are given a list with integers as elements. Your task is to create a new list where each element has been incremented by the value .
You may assume that the list contains at most integers and that each integer is in the range .
In a file listadd.py
, implement a function create
that returns the new list.
def create(t, x): # TODO if __name__ == "__main__": print(create([1,2,3],1)) # [2,3,4] print(create([1,1,1,1,1],4)) # [5,5,5,5,5] print(create([0],10**9)) # [1000000000]
Note! Implement the function so that it causes no side effects, i.e., it creates a new list and does not modify the old list.