Merge pull request #1053 from michael-k/python

Use python examples that work
pull/1059/head
Alexandru Dima 7 years ago committed by GitHub
commit d8409c7f1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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"
def feeding_frenzy(self):
self.eat(9.25)
return "Yum yum"

@ -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"
def feeding_frenzy(self):
self.eat(9.25)
return "Yum yum"

Loading…
Cancel
Save