Dieses Repository enthält Python-Dateien die im Rahmen des Wahlpflichtmoduls "Informationssysteme in der Medizintechnik" (Dozent: Prof. Dr. Oliver Hofmann) erstellt wurden und verwaltet deren Versionskontrolle.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Tag2_MittelwertAusVariablerAnzahlParameter.py 316B

123456789101112
  1. def mean(*params):
  2. x = 0
  3. sum = 0
  4. for curr in params:
  5. sum += curr
  6. x += 1
  7. return sum/x
  8. #alternativ: return sum/len(params)
  9. print("Mittelwert aus 3, 6, 9, 10, 18, 22: ", mean(3, 6, 9, 10, 18, 22))
  10. print("Mittelwert aus 1.2, 3.8, 9.0, 2, 25, 3.6: ", mean(1.2, 3.8, 9.0, 2, 25, 3.6))