0% found this document useful (0 votes)
7 views1 page

Python Class for Student Management

The document defines a Python class named 'Student' with a class attribute 'schoolname' and an initializer that sets the object's name and marks. It includes a method 'welcome' that prints a welcome message for the student. An instance of the Student class is created with the name 'chiku Don' and marks '101', followed by a call to the welcome method.

Uploaded by

anjalirathod5671
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Python Class for Student Management

The document defines a Python class named 'Student' with a class attribute 'schoolname' and an initializer that sets the object's name and marks. It includes a method 'welcome' that prints a welcome message for the student. An instance of the Student class is created with the name 'chiku Don' and marks '101', followed by a call to the welcome method.

Uploaded by

anjalirathod5671
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

class Student:

schoolname = "N.W.S.M.R.A" #this is a class attribute


def __init__(self,fullname,marks):
[Link] = fullname #this is a object attribute
[Link] = marks
print ("adding new student in database")
print(self)
#methos add
def welcome(self):
print ("welcome students",[Link])
s1 = Student("chiku Don" , 101 )
[Link]()

You might also like