Created
November 21, 2014 20:30
-
-
Save gergob/24b054229a9dc25e9686 to your computer and use it in GitHub Desktop.
Gadget class with constructor
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: | |
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 | |
my_iphone = Gadget(weight = 128, operating_system="iOS", battery_capacity=2800, screen_size=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment