|
17 | 17 | "source": [
|
18 | 18 | "In this lecture we will aim to cover:\n",
|
19 | 19 | "- OOP\n",
|
20 |
| - "- Decorators\n", |
21 |
| - "- Exception Handling" |
| 20 | + "- Decorators" |
22 | 21 | ]
|
23 | 22 | },
|
24 | 23 | {
|
|
210 | 209 | "\n",
|
211 | 210 | "You may have also noticed that this method starts and ends with `__`. \n",
|
212 | 211 | "There are other methods named in a similar way.\n",
|
213 |
| - "These methods are often called *magic methods* and used to defined very specific behaviours (If you're curious you can find out more [here](https://docs.python.org/3/reference/datamodel.html#special-method-names))." |
| 212 | + "These methods are often called *magic methods* and are used to defined very specific behaviours (If you're curious you can find out more [here](https://docs.python.org/3/reference/datamodel.html#special-method-names))." |
214 | 213 | ]
|
215 | 214 | },
|
216 | 215 | {
|
|
239 | 238 | "metadata": {},
|
240 | 239 | "outputs": [],
|
241 | 240 | "source": [
|
242 |
| - "my_person = Person(\"tomas\", 20, \"computer scientist\")\n", |
| 241 | + "my_person = Person(\"donald knuth\", 84, \"computer scientist\")\n", |
243 | 242 | "\n",
|
244 | 243 | "print(my_person.name)\n",
|
245 | 244 | "print(my_person.age)"
|
|
274 | 273 | " def introduce(self):\n",
|
275 | 274 | " print(f\"I'm {self.name}, {self.age} years old. I'm a {self.profession}.\")\n",
|
276 | 275 | "\n",
|
277 |
| - "my_person = Person(\"tomas\", 20, \"computer scientist\")\n", |
| 276 | + "my_person = Person(\"donald knuth\", 84, \"computer scientist\")\n", |
278 | 277 | "my_person.introduce()"
|
279 | 278 | ]
|
280 | 279 | },
|
|
305 | 304 | " def eat(self, food):\n",
|
306 | 305 | " return \"\"\n",
|
307 | 306 | "\n",
|
308 |
| - "my_person = Person(\"tomas\", 20, \"computer scientist\")\n", |
| 307 | + "my_person = Person(\"donald knuth\", 84, \"computer scientist\")\n", |
309 | 308 | "my_person.introduce()\n",
|
310 | 309 | "\n",
|
311 | 310 | "\n",
|
312 | 311 | "# DO NOT MODIFY\n",
|
313 |
| - "assert my_person.eat(\"pasta\") == \"tomas is eating pasta\", \"Test failed: Something went wrong, expected 'tomas is eating pasta'\"" |
| 312 | + "assert my_person.eat(\"pasta\") == \"donald knuth is eating pasta\", \"Test failed: Something went wrong, expected 'donald knuth is eating pasta'\"" |
314 | 313 | ]
|
315 | 314 | },
|
316 | 315 | {
|
|
498 | 497 | "cell_type": "markdown",
|
499 | 498 | "metadata": {},
|
500 | 499 | "source": [
|
501 |
| - "🖋️ ***This week was written by Tomas & Alistair from [Warwick AI](https://warwick.ai/)***" |
| 500 | + "🖋️ *This week was written by Tomas & Alistair from [Warwick AI](https://warwick.ai/)*" |
502 | 501 | ]
|
503 | 502 | }
|
504 | 503 | ],
|
|
0 commit comments