<jupyter_start><jupyter_text>Day_12. Inheritance `Task`You are given two classes, Person and Student, where Person is the base class and Student is the derived class. Completed code for Person and a declaration for Student are provided for you in the editor. Observe that Student inherits all the properties of Person.Complete the Student class by writing the following:```A Student class constructor, which has `4` parameters:A string, `firstName`.A string, `lastName`.An integer, `id`.An integer array (or vector) of test scores, `scores`.```A char calculate() method that calculates a Student object's average and returns the grade character representative of their calculated average:![image](https://user-images.githubusercontent.com/50367487/62290456-5d04bc00-b49c-11e9-9f80-6be026fd83e7.png)`Input Format`The locked stub code in your editor calls your Student class constructor and passes it the necessary arguments. It also calls the calculate method (which takes no arguments).You are not responsible for reading the following input from stdin: The first line contains `firstName`, `lastName`, and `id`, respectively. The second line contains the number of test scores. The third line of space-separated integers describes `Scores`.`Output Format`This is handled by the locked stub code in your editor. Your output will be correct if your Student class constructor and calculate() method are properly implemented.`Sample Input````<NAME> 81356272100 80````Sample Output```` Name: Memelli, Heraldo ID: 8135627 Grade: O```<jupyter_code>class Person:
    def __init__(self, firstName, lastName, idNumber):
        self.firstName = firstName
        self.lastName = lastName
        self.idNumber = idNumber
    
    def printPerson(self):
        print("Name:", self.lastName + ",", self.firstName)
        print("ID:", self.idNumber)

class Student(Person):
    
    def __init__(self, firstName, lastName, idNumber, scores):
        super().__init__(firstName, lastName, idNumber)
        self.scores = scores
        
    def calculate(self):
        avg = sum(self.scores)/len(self.scores)
        if avg >= 90 :
            return 'O'
        elif avg >= 80 :
            return 'E'
        elif avg >= 70:
            return 'A'
        elif avg >= 55:
            return 'P'
        elif avg >= 40:
            return 'D'
        else:
            return 'T'
line = input().split()
firstName = line[0]
lastName = line[1]
idNum = line[2]
numScores = int(input())
scores = list(map(int, input().split()))
s = Student(firstName, lastName, idNum, scores)
s.printPerson()

print("Grade:", s.calculate())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09962121212121212, 'fraction_numerical': 0.02727272727272727, 'mean_word_length': 3.6578483245149913, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '654427', 'license': 'MIT', 'n_tokens_mistral': 778, 'n_tokens_neox': 714, 'n_words': 281, 'path': 'Learn to code in 30 days/Day_12. Inheritance.ipynb', 'repo_name': 'Nam-SH/HackerRank', 'size': '2649'}