Jun-03-2020, 07:16 PM
It's a text file with 259 identical lists like so.
p8262 = [331, 83, 112, 111, 21, 67, 8]
p8264 = [384, 84, 119, 74, 28, 51, 6]
p8401 = [330, 114, 217, 81, 11, 52, 5]
...
print(f"The sum of p8262 is {sum(p8262)}")
Can just the name of the lists be assigned as a variable then I could print out the list name and sum return.
Best
p8262 = [331, 83, 112, 111, 21, 67, 8]
p8264 = [384, 84, 119, 74, 28, 51, 6]
p8401 = [330, 114, 217, 81, 11, 52, 5]
...
print(f"The sum of p8262 is {sum(p8262)}")
Can just the name of the lists be assigned as a variable then I could print out the list name and sum return.
Best