-4
def compute_invigilated_mark():
"""Prints given name and family name with overall score"""
test = 0.15
exam = 0.60
first_name = input("Given names(s)? ")
last_name = input("Family name? ")
both_names = last_name.upper() + "," + first_name.title()
new_test_percent = float(input("Test percent? ")) * test
new_exam_percent = float(input("Exam percent? ")) * exam
overall_percent = new_test_percent + new_exam_percent
end_result = overall_percent/(exam + test)
print(both_names + end_result)
compute_invigilated_mark()
我想要得到的最終結果,例如:Bourne, Jason: 66.0
告訴我這個功能有什麼問題嗎?
的rrror消息:
builtins.TypeError: Can't convert 'float' object to str implicitly.
注:我昏昏沉沉地出來這樣的,所以你可以閱讀更容易:)。
間距是有幫助的 – Elazar