+3 votes
in Class 12 by kratos

Write a class DISTRICT in Python with following specification:

Instance Attributes

– Dcode # Numeric value

– DName # String value

– People # Numeric value for Population

– Area # Numeric value

– Density # Numeric value for Population Density

1 Answer

+5 votes
by kratos
 
Best answer

Class DISTRICT ( ) :

definit(self, Dcode, DName, People, Area, Density):

self.Dcode = Dcode

self.DName = DName

self.People = People

self. Area = Area

self.Density = Density

Def display (self):

print (“District Code”, self.Dcode)

printf (“District Name”, self.Dname)

printf (“Population”, self.people)

printf (“Area”, self.Area)

printf (“Density”, self.Denstity)

...