Classes And Objects In Python Ppt Code Example


Example 1: classes and objects in python ppt

class employee:  pass  #no attributes and methods  emp_1=employee()  emp_2=employee()  #instance variable can be created manually  emp_1.first='aayushi'  emp_1.last='Johari'  emp_1.email='aayushi@edureka.co'  emp_1.pay=10000   emp_2.first='test'  emp_2.last='abc'  emp_2.email='test@company.com'  emp_2.pay=10000  print(emp_1.email)  print(emp_2.email)

Example 2: classes and objects in python ppt

class Class_name: statement-1 . . statement-N

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?