Saturday, 3 August 2019

Assignment No: 4 Student Result Calculation

'''
Assignment No: 4
To accept students five courses marks and compute his/her result.
Student is passing if he/she scores marks equal to and above 40 in each course.
If student scores aggregate greater than 75%, then the grade is distinction.
If aggregate is 60>= and <75 then the grade if first division.
If aggregate is 50>= and <60, then the grade is second division.
If aggregate is 40>= and <50, then the grade is third division.
'''
class Student: # creation of class

def __init__(self): #  __init__() function to assign values to object properties
self.marks = []
self.passed = True

def input(self): # input function is defined using the def keyword. 
          #Self parameter is a reference to the current instance of the class, and is used to access variables that belong to the class.
try:
for i in range(5):
mark = float(input("Marks: "))
self.marks.append(mark)
if mark < 40:
self.passed = False
except:
print("Enter marks in digits.")

def grade(self): #grade function is defined
if self.passed:
average = sum(self.marks)/5
if average>75:
print("Distinction")
elif average >= 60 and 75> average:
print("First Division")
elif average >= 50 and 60> average:
print("Second Division")
else: 
print("Third Division")
else:
print("Failed")

if __name__ == '__main__':
student = Student()
student.input() # function calling
student.grade()

73 comments:

  1. Student result calculation practical is easy to understand.
    👍😊👍

    ReplyDelete
  2. Error occurred while running the problem... Little bit hard

    ReplyDelete
  3. Error is fount in this practical lot of times

    ReplyDelete

  4. Easy concept... Understandable

    ReplyDelete
  5. Very nice program and easy to understand

    ReplyDelete
  6. Little bit hard but understood

    ReplyDelete
  7. While running program lots of error occurred but finally done with it 👍

    ReplyDelete
  8. Little bit confusing... But easy when we understand to correct the errors

    ReplyDelete
  9. 🔌💻🖥️🖱️⌨️🖨️💿📀 THIS PROGRAMME IS EXCELLENT

    ReplyDelete
  10. Student Result Calculation it displays the marks with class medium..✌️😎

    ReplyDelete
  11. I calculated my last exam marks by this program

    ReplyDelete
  12. Good Post. I like your blog. Thanks for Sharing.
    Python Course in Noida

    ReplyDelete
  13. Easy to understand and so much helpful

    ReplyDelete
  14. please, explain this program step by step.

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Roll No = 09
    batch no = A1

    ReplyDelete
  17. Batch-A1
    Roll no-13
    Thank you

    ReplyDelete
  18. Thanks for sharing such a Excellent Blog! We are linking too this particularly great post on our site. Keep up the great writing.
    python assignment help

    ReplyDelete

Microsoft’s latest Surface Pro X is now available in India

  Microsoft Surface Pro X 2020 is now available in India at a starting price of Rs 1,49,999.  Here's everything you would like to unders...