0% found this document useful (0 votes)
10 views1 page

Bai 5

The document is a Python script that calculates a student's average score based on various components: attendance, classwork, homework, midterm, and final exam. It assigns a letter grade (A, B, C, or D) based on the calculated average score. The grading criteria are defined with specific score ranges for each letter grade.

Uploaded by

leanhtuan022006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Bai 5

The document is a Python script that calculates a student's average score based on various components: attendance, classwork, homework, midterm, and final exam. It assigns a letter grade (A, B, C, or D) based on the calculated average score. The grading criteria are defined with specific score ranges for each letter grade.

Uploaded by

leanhtuan022006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

diemchuyencan=float(input("Moi ban nhap diem chuyen can ")) #Nhap diem

chuyen can
diembaitaptrenlop=float(input("Moi ban nhap diem bai tap tren lop "))
#Nhap diembttrenlop
btvn=float(input("Moi ban nhap diem bai tap ve nha ")) #Nhap diem bai
tap ve nha
gk=float(input("Moi ban nhap diem gk ")) #Nhap diem giua ki
ck=float(input("Moi ban nhap diem ck ")) #Nhap diem cuoi ki
tb=(0.1*diemchuyencan)+(0.1*diembaitaptrenlop)+(0.1*btvn)+(0.2*gk)
+(0.5*ck) #Bieu thuc tinh diem trung binh nhu yeu cau bai toan
print('Diem trung binh cua ban la : {0}'.format(tb)) #In ra diem trung
binh
if tb>=9: #Neu diem trung binh lon hon hoac bang 9 in ra loai A
print("Loai A")
elif tb>=7 and tb<9: #Neu diem trung binh trong khoang [7;9) in ra loai
B
print("Loai B")
elif tb>=5 and tb<7: #Neu diem trung binh trong khoang [5;7) in ra loai
C
print("Loai C")
elif tb<5 and tb>0: #Neu diem trung binh trong khoang (0;5) in ra loai
D
print("Loai D")

You might also like