Skip to content

Commit 809ee12

Browse files
committed
W5: remove random task
1 parent def20a6 commit 809ee12

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

week5/w5.ipynb

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -277,40 +277,6 @@
277277
"my_person.introduce()"
278278
]
279279
},
280-
{
281-
"cell_type": "markdown",
282-
"metadata": {},
283-
"source": [
284-
"> Task 1: Complete the `eat` method which will allow instances of `Person` to eat.\n",
285-
"\n",
286-
"`eat` should take the food name as a parameter and return \"\\<Name of the person\\> is eating \\<name of the food\\>\""
287-
]
288-
},
289-
{
290-
"cell_type": "code",
291-
"execution_count": null,
292-
"metadata": {},
293-
"outputs": [],
294-
"source": [
295-
"class Person:\n",
296-
" def __init__(self, name, age, profession):\n",
297-
" self.name = name\n",
298-
" self.age = age\n",
299-
" self.profession = profession\n",
300-
"\n",
301-
" def introduce(self):\n",
302-
" print(f\"I'm {self.name}, {self.age} years old. I'm a {self.profession}.\")\n",
303-
" \n",
304-
" def eat(self, food):\n",
305-
" return \"\"\n",
306-
"\n",
307-
"my_person = Person(\"donald knuth\", 84, \"computer scientist\")\n",
308-
"my_person.introduce()\n",
309-
"\n",
310-
"# DO NOT MODIFY\n",
311-
"assert my_person.eat(\"pasta\") == \"donald knuth is eating pasta\", \"Test failed: Something went wrong, expected 'donald knuth is eating pasta'\""
312-
]
313-
},
314280
{
315281
"cell_type": "markdown",
316282
"metadata": {},
@@ -342,7 +308,7 @@
342308
" \n",
343309
" def eat(self, food):\n",
344310
" self._energy += 9\n",
345-
" return \"\"\n",
311+
" print(f\"Eating food {food}\")\n",
346312
"\n",
347313
" def walk(self):\n",
348314
" if self._energy < 10:\n",

0 commit comments

Comments
 (0)