Hey guys quick question,
this is the code that I've written so far:
and the output is:
5.5
Tom Bombadil
I want it so that it will print: Tombadil 5.5. on one line.
Thanks in advance guys !
this is the code that I've written so far:
total = 0 def print_student(student): informatie_student = student.split("__________") naam_student = informatie_student[0] cijfers_student = informatie_student[1] print_cijferstudent(cijfers_student) print naam_student def print_cijferstudent(input_cijfer): enkel_cijfer = input_cijfer.split(" ") cijfer1 = float(enkel_cijfer[0]) cijfer2 = float(enkel_cijfer[1]) cijfer3 = float(enkel_cijfer[2]) gemiddelde = round((total + cijfer3 + cijfer2 + cijfer1) / len(enkel_cijfer), 1) print gemiddelde students = open('input.txt').readlines() for student in students: print_student(student)the input is: Tom Bombadil__________6.5 5.5 4.5
and the output is:
5.5
Tom Bombadil
I want it so that it will print: Tombadil 5.5. on one line.
Thanks in advance guys !