File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ Let's use it to define an empty class.
7777>> >
7878```
7979
80+ The ` pass ` is needed here, just like [ when defining functions that do
81+ nothing] ( defining-functions.md#first-functions ) .
82+
8083Note that I named the class ` Website ` , not ` website ` . This way we know
8184that it's a class. Built-in classes use lowercase names (like ` str `
8285instead of ` Str ` ) because they are faster to type, but use CapsWord
Original file line number Diff line number Diff line change @@ -68,9 +68,14 @@ Let's use it to define a function that does nothing.
6868>> >
6969```
7070
71- Seems to be working so far, we have a function. Actually it's just
72- a value that is assigned to a variable called ` do_nothing ` . Let's see
73- what happens if we call it.
71+ Seems to be working so far, we have a function. It's just a value that
72+ is assigned to a variable called ` do_nothing ` .
73+
74+ The ` pass ` is needed here because without it, Python doesn't know when
75+ the function ends and it gives us a syntax error. We don't need the
76+ ` pass ` when our functions contain something else.
77+
78+ Let's see what happens if we call our function.
7479
7580``` python
7681>> > do_nothing()
You can’t perform that action at this time.
0 commit comments