Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 892af91

Browse filesBrowse files
committed
Adding more explanations to exercise
1 parent d5f3256 commit 892af91
Copy full SHA for 892af91

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Collapse file

‎lectures/functions.md‎

Copy file name to clipboardExpand all lines: lectures/functions.md
+4-2Lines changed: 4 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,17 @@ write our own version as an exercise.
368368
for any positive integer $n$.
369369
370370
2. In addition, try to add a new argument for your function.
371-
The argument will take in a lambda expression f that transforms n to $f(n) = n^2 + 1$ if n is even, and $f(n) = n^2$ if n is odd.
372-
The default value will be $f(n) = n$.
371+
The argument takes a function `f` that transforms n to $f(n) = n^2 + 1$ if n is even, and $f(n) = n^2$ if n is odd.
372+
The default value should be $f(n) = n$.
373373
374374
For example
375375
376376
- The default case `factorial(3)` should return $3!$
377377
- `factorial(3,f)` should return $9!$
378378
- `factorial(2,f)` should return $5!$
379379
380+
Try to use lambda expressions to define the function `f`.
381+
380382
```
381383

382384
```{solution-start} exercise_1

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.