adding all files done so far

This commit is contained in:
2019-07-10 20:18:31 +01:00
parent 13c0e9cb4d
commit e3ac390e8b
76 changed files with 8644 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
class Robot:
def __init__(self, name, build_year, lk=0.5,
lp=0.5):
self.name = name
self.build_year = build_year
self.__potential_physical = lk
self.__potential_psychic = lp
@property
def condition(self):
s = self.__potential_physical + self.__potential_psychic
if s <= -1:
return "I feel miserable!"
elif s <= 0:
return "I feel bad!"
elif s <= 0.5:
return "Could be worse!"
elif s <= 1:
return "Seems to be okay!"
else:
return "Great!"
def printer(self):
return self.condition
def __get__(self, instance, owner):
return 'get'
x = Robot("Marvin", 1979, 0.2, 0.4)
y = Robot("Caliban", 1993, -0.4, 0.3)