In this we are going to see a basic program to get user input using classes in Python Programming Language.
class HFC:
def getdata(self):
self.name = input("Enter Employee name: ")
self.sal = int(input("Enter Employee salary: "))
self.ph = int(input("Enter Employee phone number: "))
def display(self):
print("Name:", self.name)
print("Salary:", self.sal)
print("Phone number", self.ph)
h = HFC()
h.getdata()
h.display()
#Coded by SAAHIL
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP