Feb-13-2022, 04:50 PM
tab = '5;6;9;7'.split(';') tab = list(map(int, tab)) somme = 0 total = 0 for number in tab: total += number print(f'Sum of tab list is: {total}') for number in tab: print((somme + number)/total)
Output:Sum of tab list is: 27
0.18518518518518517
0.2222222222222222
0.3333333333333333
0.25925925925925924
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags