Last active
August 29, 2015 14:10
-
-
Save gergob/0f850c08256b6c219395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Gadget: | |
"""A class used for modelling Gadgets in a web shop.""" | |
__weight = 100 | |
__operating_system = None | |
__battery_capacity = 2000 | |
__screen_size = 1 | |
def __init__(self, weight, operating_system, battery_capacity, screen_size): | |
self.__weight = weight | |
self.__operating_system = operating_system | |
self.__battery_capacity = battery_capacity | |
self.__screen_size = screen_size | |
def get_weight(self): | |
return self.__weight | |
def set_weight(self, weight): | |
self.__weight = weight | |
weight = property(get_weight, set_weight) | |
@property | |
def operating_system(self): | |
return self.__operating_system | |
@operating_system.setter | |
def operating_system(self, new_os): | |
self.__operating_system = new_os |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment