How To Define And Access Classes In Python3

1.How To Define A Simple Class In Python3.

class Student:

    def display(self):
        print("Simple Student")



s=Student()
s.display()

2.Class With Parameter Functions In Python3.

class Student:

    def display(self,a,b):
        print("Sum",(a+b))


#s=Student()
#s.display(10,20)
Student().display(10,20)

3.Class With Global Variable In Python3.

class Student:
    c=0
    def display(self,a,b):
        self.c=a+b
    def displayResult(self):
        print("Sum", self.c)



s=Student()
s.display(10,20)
s.displayResult()

4.Class With Local Variable In Python3.

class Student:

    def display(self,a,b):
        c=a+b
        print("Sum",c)



s=Student()
s.display(10,20)