Task text: Generate ten lists of random numbers. Print them and the sum of their elements on the screen. Find among them one with the maximum sum of elements. Specify what it is in the account, re-display this list and the sum of its elements. Filling out the list and counting the sum of its elements arrange in the form of individual functions.
Now actually to the problem: in the first function (see below code) I have 10 lists filled in, in the second function the sum is found in 10 lists, but I generate new 10 lists, and I need to work with the result obtained in the first one, that is, with old lists, the question is how to fix it?
Problem number 2: I do not know how to re-list with the maximum sum of the elements and the list itself
import random n = int(input("Введите кол-во возможных случайных:")) b = int(input("Введите диапазон случайных значений:")) def func_1(n,b): d = [[random.randrange(b) for i in range(n)] for i in range(10)] print("Исходные 10 списков:",d) func_1(n,b) def func_2(n,b): d = [[sum(random.randrange(b) for i in range(n))] for i in range(10)] print("сумма элементов в каждом из 10 списков:",d) return d func_2(n,b) d = func_2(n,b) g = max(d) c = len(d) for i in range(c): if d[i] == g: print("Номер максимального элемента:",g,i)