File tree 2 files changed +11
-3
lines changed
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.
77
77
>> >
78
78
```
79
79
80
+ The ` pass ` is needed here, just like [ when defining functions that do
81
+ nothing] ( defining-functions.md#first-functions ) .
82
+
80
83
Note that I named the class ` Website ` , not ` website ` . This way we know
81
84
that it's a class. Built-in classes use lowercase names (like ` str `
82
85
instead 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.
68
68
>> >
69
69
```
70
70
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.
74
79
75
80
``` python
76
81
>> > do_nothing()
You can’t perform that action at this time.
0 commit comments