May-07-2019, 08:07 PM
HI
i am getting an error for incorrect indentation but can not find the error.
i am getting an error for incorrect indentation but can not find the error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
##30/04/19 ## ##increment attributes through method class Ereader(): """A class to represent an ereader""" def __init__ ( self , make, model, backlight, battery, screentype): """initialise the atributes to represent an ererader""" self .make = make self .modle = model self .backlight = backlight self .battery = battery self .screentype = screentype self .libararycount = 0 def get_ereader_name( self ): """return a formatted description for our ereader""" long_name = self .make + " - " + self .model + " - " + self .backlight + " - " + self .battery + " - " + self .screentype return long_name.title() def read_libarary_count( self ): print ( "You Have " + str ( self .libararycount) + " books in your libarary" ) def update_laibary_count( self , ebook_count): """set the libary count""" self .libararycount = ebook_count def increment_libary_count( self , purchased_ebooks): """add new ebboks to libary count""" self .libararycount + = purchased_ebooks class Screen(): """create a class to model the screen of a kindle fire""" def__init__ ( self , screen_resoloution = '1280*800' ) """initialise the screens attributes""" self .screen_resoloution = screen_resoloution def describe_screen( self ): """print out some marketing information about the kindle fire""" ##this tells the child class to call the features from the parent class print ( "fire HD 8 features a wide screen " + self .screen_resoloution + " HD screen." ) class Kindlefire(Ereader): """represents aspects of an ereader specific to a kindle fire then initialise atributes specific to a kindle fire""" def __init__ ( self , make, modle, backlight, battery, screentype): """initialize attributes for the kindle fire""" super ().__init__(make, modle, backlight, battery, screentype) self .firescreen = Screen my_kindle_fire = Kindlefire( 'amazon' , 'kindlefire' , 'backlight' , '12 hour battrey life' , 'colorscreen' ) print (my_kindle_fire.get_ereader_name()) my_kindle_fire.firescreen.describe_screen() |