THE CHALLENGESUM_PRODUCT_AVERAGE — The sum, the product and the average.
Fill an array T with n integers (5 < n <= 10) between 1 and 20, then print the sum, the product and the arithmetic mean of the elements of T.
Input:
5
1
4
7
12
15
Output:
La somme : 39
Le produit : 5040
La moyenne arithmétique : 7.8
Challenge: ONE single loop computes the sum AND the product - sum() and math.prod() are not allowed.
Checks (verified automatically before your code runs):
- At most 2 loops in the whole program (for, while and comprehensions all count).
- Do not use sum().
- Do not use prod().