Skip to content

Commit d051b23

Browse files
authored
07-cond.md: Introduce abs, linking to documentation (#841)
* Introduce `abs`, linking to documentation * Hide abs hint and exemplify usage
1 parent 9c677be commit d051b23

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

_episodes/07-cond.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,19 @@ freeing us from having to manually examine every plot for features we've seen be
308308
> Compare your implementation with your partner's:
309309
> do you get the same answer for all possible pairs of numbers?
310310
>
311+
> > ## Hint
312+
> > There is a [built-in function `abs`][abs-function] that returns the absolute value of
313+
> > a number:
314+
> > ~~~
315+
> > print(abs(-12))
316+
> > ~~~
317+
> > {: .language-python}
318+
> > ~~~
319+
> > 12
320+
> > ~~~
321+
> > {: .output}
322+
> {: .solution}
323+
>
311324
> > ## Solution 1
312325
> > ~~~
313326
> > a = 5
@@ -477,4 +490,6 @@ freeing us from having to manually examine every plot for features we've seen be
477490
> {: .solution}
478491
{: .challenge}
479492
493+
[abs-function]: https://docs.python.org/3/library/functions.html#abs
494+
480495
{% include links.md %}

0 commit comments

Comments
 (0)