Created
June 18, 2022 08:34
-
-
Save paley777/c98b4d55b197381d276ac8069ecca7fa to your computer and use it in GitHub Desktop.
determine degree of value using python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tugas = float(input("Masukkan nilai Tugas: ")) | |
uts = float(input("Masukkan nilai UTS: ")) | |
uas = float(input("Masukkan nilai UAS: ")) | |
nilai = (0.15 * tugas) + (0.35 * uts) + (0.50 * uas) | |
if nilai > 80: | |
grade = 'A' | |
elif nilai > 70: | |
grade = 'B' | |
elif nilai > 60: | |
grade = 'C' | |
elif nilai > 50: | |
grade = 'D' | |
else: | |
grade = 'E' | |
if nilai > 60: | |
status = 'Lulus' | |
else: | |
status = 'Tidak Lulus' | |
print('Nilai Akhir: %0.2f' % nilai) | |
print('Grade: {}'.format(grade)) | |
print('Status: {}'.format(status)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tugas = float(input("Masukkan nilai Tugas: "))
uts = float(input("Masukkan nilai UTS: "))
uas = float(input("Masukkan nilai UAS: "))
nilai = (0.15 * tugas) + (0.35 * uts) + (0.50 * uas)
if nilai > 80:
grade = 'A'
elif nilai > 70:
grade = 'B'
elif nilai > 60:
grade = 'C'
elif nilai > 50:
grade = 'D'
else:
grade = 'E'
if nilai > 60:
status = 'Lulus'
else:
status = 'Tidak Lulus'
print('Nilai Akhir: %0.2f' % nilai)
print('Grade: {}'.format(grade))
print('Status: {}'.format(status))
Comment