def report(n, m, d, e): # Mathe s = 0 for g in m: s = s + g a1 = round(s / len(m) * 2) / 2 # Deutsch s = 0 for g in d: s = s + g a2 = round(s / len(d) * 2) / 2 # Englisch s = 0 for g in e: s = s + g a3 = round(s / len(e) * 2) / 2 x = round((a1 + a2 + a3) / 3, 1) t = 'Zeugnis ' + n + '\n' t = t + 'Mathe: ' + str(a1) + '\n' t = t + 'Deutsch: ' + str(a2) + '\n' t = t + 'Englisch: ' + str(a3) + '\n' t = t + 'Schnitt: ' + str(x) + '\n' c = 0 if a1 < 4: c = c + 1 if a2 < 4: c = c + 1 if a3 < 4: c = c + 1 if x >= 4 and c <= 1: t = t + 'promoviert' else: t = t + 'nicht promoviert' print(t) return t