Učitavanje zadatka…
The arithmetic mean helps you quickly understand a typical value in a list, such as an average score, price, or time. Write a function mean that adds all numbers in nums and divides the sum by the number of items. If the list is empty, return 0 to avoid division by zero. Use ordinary division, so the result may be fractional.
[1, 2, 3, 4]2.5[10]10[]0def mean(nums: list[float]) -> float:
Prijavi se da vidiš povijest predaja
PrijavaPrijavi se da koristiš AI mentora
Prijava[1,2,3,4]2.5[10]10[]0[2,4,6]4[1,2,3,4,5,6,7,8,9,10]5.5[-1,1]0