From 801fa1e84b41b7fcd213cfa5f9f07bfd0cd2eb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=A4ufl?= Date: Wed, 5 Sep 2018 22:36:44 +0200 Subject: [PATCH] Use python examples that work --- test/samples/sample.python.txt | 19 ++++++++++--------- website/index/samples/sample.python.txt | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/test/samples/sample.python.txt b/test/samples/sample.python.txt index d811ccca..d925366a 100644 --- a/test/samples/sample.python.txt +++ b/test/samples/sample.python.txt @@ -1,12 +1,13 @@ -from banana import * +import banana + class Monkey: - # Bananas the monkey can eat. - capacity = 10 - def eat(self, N): - '''Make the monkey eat N bananas!''' - capacity = capacity - N*banana.size + # Bananas the monkey can eat. + capacity = 10 + def eat(self, n): + """Make the monkey eat n bananas!""" + self.capacity -= n * banana.size - def feeding_frenzy(self): - eat(9.25) - return "Yum yum" \ No newline at end of file + def feeding_frenzy(self): + self.eat(9.25) + return "Yum yum" diff --git a/website/index/samples/sample.python.txt b/website/index/samples/sample.python.txt index d811ccca..d925366a 100644 --- a/website/index/samples/sample.python.txt +++ b/website/index/samples/sample.python.txt @@ -1,12 +1,13 @@ -from banana import * +import banana + class Monkey: - # Bananas the monkey can eat. - capacity = 10 - def eat(self, N): - '''Make the monkey eat N bananas!''' - capacity = capacity - N*banana.size + # Bananas the monkey can eat. + capacity = 10 + def eat(self, n): + """Make the monkey eat n bananas!""" + self.capacity -= n * banana.size - def feeding_frenzy(self): - eat(9.25) - return "Yum yum" \ No newline at end of file + def feeding_frenzy(self): + self.eat(9.25) + return "Yum yum"