Last active
November 1, 2017 07:41
-
-
Save grihabor/439bd17343dd355e4f5b0ebaf89bee07 to your computer and use it in GitHub Desktop.
Create object instance with custom constructor #example
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 Color: | |
def __init__(color, r, g, b): | |
color.r = r | |
color.g = g | |
color.b = b | |
white = Color(255, 255, 255) | |
print(white.r, white.g, white.b) | |
#|255 255 255 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment