Learn Python-3: Python Technologies by ANSARI HASANRAZA

Learn Python-3: Python Technologies by ANSARI HASANRAZA

Author:ANSARI, HASANRAZA [ANSARI, HASANRAZA]
Language: eng
Format: epub
Published: 2020-07-03T16:00:00+00:00


__doc__ − Class documentation string or none, if undefined.

__name__ − Class name.

__module__ − Module name in which the class is defined. This attribute is "__main__" in interactive mode.

__bases__ − A possibly empty tuple containing the base classes, in the order of their occurrence in the base class list.

For the above class let us try to access all these attributes −

Live Demo

#!/usr/bin/python3

class Employee :

'Common base class for all employees'

empCount = 0

def __init__( self , name, salary):

self . name = name

self . salary = salary

Employee . empCount += 1

def displayCount( self ):

print ( "Total Employee %d" % Employee . empCount)

def displayEmployee( self ):

print ( "Name : " , self . name, ", Salary: " , self . salary)

emp1 = Employee ( "Zara" , 2000 )

emp2 = Employee ( "Manni" , 5000 )

print ( "Employee.__doc__:" , Employee . __doc__)

print ( "Employee.__name__:" , Employee . __name__)

print ( "Employee.__module__:" , Employee . __module__)

print ( "Employee.__bases__:" , Employee . __bases__)

print ( "Employee.__dict__:" , Employee . __dict__ )



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
Building Machine Learning Systems with Python by Richert Willi Coelho Luis Pedro(2047)
Hands-On Python Deep Learning for the Web by Anubhav Singh(1892)
Mastering OpenCV 4 with Python by Fernández Villán Alberto;(1740)
Building Serverless Python Web Services with Zappa by Abdulwahid Abdulhaque Barguzar(1708)
Mastering Python Data Visualization by Kirthi Raman(1640)
PYTHON PROGRAMMING ADVANCED: The Guide for Data Analysis and Data Science. Discover Machine Learning With the Optimum Recipes for Mastering Python and ... (Crash Course Tips and Tricks Book 3) by ERIC MATTHEWS & LEWIS TAYLOR(1626)
Python for Finance Cookbook by Eryk Lewinson(1589)
Python for Finance: Analyze Big Financial Data by Yves Hilpisch(1588)
Supervised Machine Learning with Python by Taylor Smith(1474)
Django 3 By Example by Antonio Melé(1440)
Interactive Data Visualization with Python by Anshu Kumar & Shubhangi Hora & Sharath Chandra Guntuku & Abha Belorkar(1295)
Hands-On GPU Programming with Python and CUDA by Dr. Brian Tuomanen(1227)
Python Feature Engineering Cookbook by Soledad Galli(1218)
Applied Deep Learning with Keras by Matthew Moocarme Mahla Abdolahnejad and Ritesh Bhagwat(1214)
Python Deep Learning. by Ivan Vasilev(1203)
Scientific Computing with Python 3 by Claus Fuhrer & Jan Erik Solem & Olivier Verdier(1187)
Hands-On Image Processing with Python by Sandipan Dey(1185)
Flask Framework Cookbook by Shalabh Aggarwal(1167)
Training Systems using Python Statistical Modeling by Curtis Miller(1125)
Django 3 Web Development Cookbook - Fourth Edition by Aidas Bendoraitis(1124)