#Program to create class and parameterized constructor in python 
#constructor are called as special fucntions
#special functions get automatically called when we create object of class
#constructors are used to initialize data members of class
#example     __init__(self):

print("Program to create class and parameterized constructor in python ")
class Student:
    def __init__(self,sname,rno):    #constructor with parameter
        self.sname=sname             #data members of class student initialized using constructor
        self.rno=rno    
        
#function to print values of data members
    def printData(self): 
        print("Student name: ",self.sname)  
        print("Student Roll Number: ",self.rno)

 
#creating object 
s1=Student("Dkon",202)    #calling of constructor automatically


#printing student information using printData() 
print("Student details")

s1.printData()






34b336cc5a4a0e1506bef2d861815902042c69d6
<mask token>


class Student:
    <mask token>

    def printData(self):
        print('Student name: ', self.sname)
        print('Student Roll Number: ', self.rno)


<mask token>

<mask token>


class Student:

    def __init__(self, sname, rno):
        self.sname = sname
        self.rno = rno

    def printData(self):
        print('Student name: ', self.sname)
        print('Student Roll Number: ', self.rno)


<mask token>

print('Program to create class and parameterized constructor in python ')


class Student:

    def __init__(self, sname, rno):
        self.sname = sname
        self.rno = rno

    def printData(self):
        print('Student name: ', self.sname)
        print('Student Roll Number: ', self.rno)


<mask token>
print('Student details')
s1.printData()

print('Program to create class and parameterized constructor in python ')


class Student:

    def __init__(self, sname, rno):
        self.sname = sname
        self.rno = rno

    def printData(self):
        print('Student name: ', self.sname)
        print('Student Roll Number: ', self.rno)


s1 = Student('Dkon', 202)
print('Student details')
s1.printData()

#Program to create class and parameterized constructor in python 
#constructor are called as special fucntions
#special functions get automatically called when we create object of class
#constructors are used to initialize data members of class
#example     __init__(self):

print("Program to create class and parameterized constructor in python ")
class Student:
    def __init__(self,sname,rno):    #constructor with parameter
        self.sname=sname             #data members of class student initialized using constructor
        self.rno=rno    
        
#function to print values of data members
    def printData(self): 
        print("Student name: ",self.sname)  
        print("Student Roll Number: ",self.rno)

 
#creating object 
s1=Student("Dkon",202)    #calling of constructor automatically


#printing student information using printData() 
print("Student details")

s1.printData()





