LU02.L03 - Durchschnitt von Zahlen

def average(list):
    if len(list) > 0:
        return sum(list)/len(list)
    else:
        return 0
 
if __name__ == '__main__':
    numbers = [1, 2, 3, 4, 5]
    print('The average of the numbers is:', average(numbers))

© Kevin Maurizi

  • modul/m323/learningunits/lu02/loesungen/pure3.txt
  • Last modified: 2023/11/13 08:56
  • by 127.0.0.1