testing julia
This commit is contained in:
parent
7c841df98a
commit
b45fe0321f
3 changed files with 55 additions and 8 deletions
14
schule/mathe/jupyter/julia.jl
Normal file
14
schule/mathe/jupyter/julia.jl
Normal file
|
@ -0,0 +1,14 @@
|
|||
function mittelwert(list::Vector{<:Tuple{<:Real, <:Real}})
|
||||
upper_sum = sum(wert * anzahl for (wert, anzahl) in list)
|
||||
total_count = sum(anzahl for (_, anzahl) in list)
|
||||
return upper_sum/total_count
|
||||
end
|
||||
|
||||
|
||||
input = [
|
||||
(1,0)
|
||||
(3,0.4)
|
||||
(5,6)
|
||||
]
|
||||
|
||||
mittelwert(input)
|
Loading…
Add table
Add a link
Reference in a new issue