Package schlachtfeld :: Module statistik
[hide private]
[frames] | no frames]

Source Code for Module schlachtfeld.statistik

 1  #!/bin/env python 
 2  # encoding: utf-8 
 3   
 4  # Schlachtfeld - Großkämpfe im EWS System 
 5  #   http://rpg-tools-1d6.sf.net 
 6  # Copyright © 2007 - 2007 Achim Zien 
 7   
 8  # This program is free software; you can redistribute it and/or modify 
 9  # it under the terms of the GNU General Public License as published by 
10  # the Free Software Foundation; either version 2 of the License, or 
11  # (at your option) any later version. 
12   
13  # This program is distributed in the hope that it will be useful, 
14  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
16  # GNU General Public License for more details. 
17   
18  # You should have received a copy of the GNU General Public License 
19  # along with this program; if not, write to the Free Software 
20  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 
21  # MA 02110-1301 USA 
22   
23   
24 -class Statistik:
25 - def __init__(self, eingabe=[12]):
26 self.eingabe = eingabe
27 - def durchschnitt(self):
28 gesamtwert = 0 29 anzahl = 0 30 for wert in self.eingabe: 31 gesamtwert += wert 32 anzahl += 1 33 durchschnitt = 1.0 * gesamtwert / anzahl 34 return durchschnitt 35