Skip to content

Instantly share code, notes, and snippets.

@dketov
Created October 16, 2014 17:01
Show Gist options
  • Save dketov/0e157c1b704ef979308c to your computer and use it in GitHub Desktop.
Save dketov/0e157c1b704ef979308c to your computer and use it in GitHub Desktop.
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