File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,6 +151,32 @@ average(values)
151151> return values[1]
152152> ~~~
153153> {: .python}
154+ > >
155+ > > ## Solution
156+ > >
157+ > > Change the `#` to `'''` to change to docstring:
158+ > >
159+ > > ~~~
160+ > > def middle(a, b, c):
161+ > > ''' Return the middle value of three.
162+ > > Assumes the values can actually be compared.
163+ > > '''
164+ > > values = [a, b, c]
165+ > > values.sort()
166+ > > return values[1]
167+ > > ~~~
168+ > > {: .python}
169+ > >
170+ > > Calling `help` on the `middle` function now shows the docstring:
171+ > > ~~~
172+ > > help (middle)
173+ > > Help on function middle in module __main__:
174+ > > middle(a, b, c)
175+ > > Return the middle value of three.
176+ > > Assumes the values can actually be compared.
177+ > > ~~~
178+ > > {: .python}
179+ > {: .solution}
154180{: .challenge}
155181
156182> ## Clean Up This Code
You can’t perform that action at this time.
0 commit comments