Browse Source

Das ist ein Commit-Test für Janko

master
Jonka Winkle 6 years ago
parent
commit
95b84517e8
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      Tag2_MittelwertAusVariablerAnzahlParameter.py

+ 12
- 0
Tag2_MittelwertAusVariablerAnzahlParameter.py View File

@@ -0,0 +1,12 @@
def mean(*params):
x = 0
sum = 0
for curr in params:
sum += curr
x += 1
return sum/x
#alternativ: return sum/len(params)

print("Mittelwert aus 3, 6, 9, 10, 18, 22: ", mean(3, 6, 9, 10, 18, 22))

print("Mittelwert aus 1.2, 3.8, 9.0, 2, 25, 3.6: ", mean(1.2, 3.8, 9.0, 2, 25, 3.6))

Loading…
Cancel
Save