Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Room():
- def __init__(self,room_name):
- self.name=room_name
- self.description=None
- def set_description(self, room_description):
- self.description = room_description
- def get_description(self):
- return self.description
- def set_name(self, room_name):
- self.name = room_name
- def get_name(self):
- return self.name
- def describe(self):
- print( self.description )
- if __name__ == "__main__":
- a=Room('Dinning Room')
- a.set_description('The place to cook')
- print(a.get_name())
- print(a.get_description())
- a.set_name('Bathroom')
- a.set_description('The place to wash your hands')
- print(a.get_name())
- print(a.get_description())
- a.describe()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement