Also etwa so:
Code: Alles auswählen
noten = []
for note in range(10):
note = random.randint(1,4)
noten.append(str(note))
text = "Otto hat im Zeugnis folgende Noten:<br>{}<br>Berechne die Durchschnittsnote!".format(", ".join(noten))