Created
March 4, 2019 18:10
-
-
Save dp-quant/1bed5a74642de55f739c2fa7a668f713 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Building: | |
__matherial = None | |
__color = None | |
__quantity = 0 | |
def __init__(self, matherial, color, number = 0): | |
self.__matherial = matherial | |
self.__color = color | |
self.__quantity = number | |
def place(self): | |
if self.__quantity <= 0: | |
return 'out of stock' | |
elif 0 < self.__quantity <= 100: | |
return 'warehouse' | |
else: | |
return 'remote warehouse' | |
b1 = Building('iron', 'gray', 100) | |
b2 = Building('brick', 'red', 50) | |
b3 = Building('wood', 'green', 1500) | |
b4 = Building('silver', 'grey') | |
print(b1.place()) | |
print(b2.place()) | |
print(b3.place()) | |
print(b4.place()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment