Skip to content

Instantly share code, notes, and snippets.

@paley777
Created June 18, 2022 08:34
Show Gist options
  • Save paley777/c98b4d55b197381d276ac8069ecca7fa to your computer and use it in GitHub Desktop.
Save paley777/c98b4d55b197381d276ac8069ecca7fa to your computer and use it in GitHub Desktop.
determine degree of value using python
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))
@blandinabaik
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment