Skip to content

Instantly share code, notes, and snippets.

@meshileya
Created November 23, 2017 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meshileya/921175fe267e1a4c17fa3dd580024d95 to your computer and use it in GitHub Desktop.
Save meshileya/921175fe267e1a4c17fa3dd580024d95 to your computer and use it in GitHub Desktop.
the_num = int(raw_input("Enter number of courses ==> "))
total_course_unit=0.0
total_course_grade = 0.0
total_grade_point = 0.0
for a in range (0,the_num):
course_code = str(raw_input("Enter the course code ==> "))
course_unit = int(raw_input("Enter the course unit ==> "))
total_course_unit=total_course_unit+course_unit
course_grade = int(raw_input("Enter the course grade ==> "))
total_course_grade = total_course_grade + course_grade
if(course_grade >= 70 and course_grade <=100):
grade_point = 5* course_unit
print 'Course grade ==> A'
elif (course_grade >= 60 and course_grade <=69):
grade_point = 4* course_unit
print 'Course grade ==> B'
elif (course_grade >= 50 and course_grade <=59):
grade_point = 3* course_unit
print 'Course grade ==> C'
else:
grade_point = 0* course_unit
print 'Course grade ==> F'
total_grade_point = total_grade_point+ grade_point
print 'Total Course Unit ==> ', total_course_unit
print 'GPA ==> ', total_grade_point/ total_course_unit
@taymee
Copy link

taymee commented Nov 23, 2017

Wow
We can proceed

@meshileya
Copy link
Author

Won't mind seeing your gist as well.

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