# Write a function that take a list of integers, # returns a list of integers. # Each item of the resultant list is a sum of its value # and each item in the list. # For example, if an incoming list is # [1, 2, 3, 4], the function would return # [2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8] # where (from the resultant list) # 2, 3, 4, 5 are results of 1+1, 1+2, 1+3, 1+4 # 3, 4, 5, 6 are results of 2+1, 2+2, 2+3, 2+4 # 4, 5, 6, 7 are results of 3+1, 3+2, 3+3, 3+4 # 5, 6, 7, 8 are results of 4+1, 4+2, 4+3, 4+4 # Hint: you can have a loop inside another loop # For practice, write the function in 2 versions: # Version 1: use for loop def repeated_sum_list(lst): print(repeated_sum_list([1, 2, 3, 4])) print(repeated_sum_list([-1, 2, -3, 4])) # Version 2: use while loop def repeated_sum_list2(lst): print(repeated_sum_list2([1, 2, 3, 4])) print(repeated_sum_list2([-1, 2, -3, 4]))