Created
October 16, 2014 17:01
-
-
Save dketov/0e157c1b704ef979308c 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
def samogon_cook(self): | |
sam_base_formula = [1.0, 0.1, 0.2, 3.0] | |
if 0.0 in self.res: | |
print "Ошибка, нехватает компонетов" | |
return self.sam_info() | |
sam_calc = min(map(lambda x, y: y/x, sam_base_formula, self.res)) | |
self.res = map(lambda x, y: (y - x*sam_calc), sam_base_formula, self.res) | |
print "Варка самогона..." | |
time.sleep(sam_calc) | |
return "Сварено: %.2f л" % sam_calc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment