TypeError: unsupported operand type(s) for /: 'tuple' and 'int'
Nhờ anh em xem giùm mình lỗi này. Mình là new bee
Thanks you all.
calculate average grade for each of subject
subject1 = raw_input("The first subject: "),
s1_grade1 = float(raw_input ("please input your first grade: ")),
s1_grade2 = float(raw_input ("please input your second grade: ")),
s1_grade3 = float(raw_input("please input your third grade: ")),
avg_grade = float(((s1_grade1 + s1_grade2) / 2) * (30/100) + s1_grade3 *
(70 / 100))
print “your average grade for first subject is %f” % avg_grade
Sau khi compile thi no bi the nay:
PS C:python_practice> python exe11_1.py
Calcualting average grade for student
The first subject: kdhs
please input your first grade: 8
please input your second grade: 8
please input your third grade: 6
Traceback (most recent call last):
File “exe11_1.py”, line 8, in
avg_grade = float(((s1_grade1 + s1_grade2) / 2) * (30/100) + s1_grade3 *
TypeError: unsupported operand type(s) for /: ‘tuple’ and ‘int’
Xóa tất cả dấy phẩy (,) ở cuối các lệnh.
Thanks Ban. Issue has gone.
Nhưng sao kết quả ở phép tính điểm trung bình của mình nó lại ra 0.000 nhỉ ?