PRG Py

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

class student:

"""A commom base class for all student"""


total_student=0
def __init__(self):
def __init__(self,roll_number,name,standard):
self.roll_number=roll_number
self.name=name
self.standard=standard
self.marks=None
student.total_students +=1
#student.total_student=total_studeny +1
student=student(1,"ABC","X")
print(student,total_students)

student4=student(2,'pqr','XI')
print(student.total_students)
***
class student:
def __init__(self):
self.rollno=0
self.name=""
defset_student(self,rollno,name):
self.rollno=rollno
self.name=name
student=student()
print(student.name)
student.set_student(1,"PQR")
student

*****
private===__(double)
protected===_(single)

*****
for print we can use (........%d),(f"""name{.....}"""),("name: " +....)

*****

You might also like