'exam' object has no attribute 'mark'

class student:

id=0

name=""

def getdata(self):

    self.id=input("Enter Id :")

    self.name=input("Enter Student Name :")

class exam(student):

    sub1=0

    sub2=0

def mark(self):

    self.sub1=int(input("Enter First subject mark"))

    self.sub2=int(input("Enter second subject mark"))

def result(self):

    print("student id",self.id)

    print("student name",self.name)

    print("subject1",self.sub1)

    print("subject2",self.sub2)

    total=self.sub1+self.sub2

    print("total is",total)

    per=total/2

    print("percentage is",per)

ex=exam()

ex.getdata()

ex.mark()

ex.result()