Python Class || Functions || Classes || Python
In this we are going to see a basic program on functions using classes in Python Programming Language.



class Student:
    def __init__(self):
        self.id = 0
        self.name = str()
 
    def display(self):
        print("Enter Name and ID:-", end='')
        print("\n", end='')
        self.name = input()
        self.id = int(input())
        print(self.id)
        print(self.name, end='')
 
 
s1 = Student()
s1.display()
 
#Coded by SAAHIL


#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post