suppose the data is like this
[["Alice", 12, tex, "15"], ["Bob", 13, 91.0, "A"], ["Charlie", 5, 5, "5"]]
so how i do this after addition the new data wil be ["Alice", 30, "96.5", "20"]
i mean
For each index (column in list of lists):
If 2 or more values at that index are numbers, return their sum.
If only 1 value is a number, return that number.
If no numbers at that index, return the value from the first sublist.
Loop through each column index (i from 1 to number of columns):
Initialize sum to 0 and count to 0.
For each row in the list:
Get the item at index i.
If it's a number:
Convert to number (if it's text)
Add it to sum
Increment count by 1
After checking all rows:
If count == 0: add item from first row at index i to finalList
If count == 1: add the number (not sum) to finalList
If count > 1: add the total sum to finalList
Result is stored in finalList. just checking working or not
Have you tried the method given in post no.2 or anything?
My suggestion also others suggestion works based on that thing only. if is number and not empty