generated from jhudsl/OTTR_Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from fhdsl/S4
w2 lesson planning
- Loading branch information
Showing
82 changed files
with
6,704 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
title: "Untitled" | ||
format: revealjs | ||
editor: visual | ||
--- | ||
|
||
## Grammar Structure 3: Evaluation of Functions | ||
|
||
A function has a **function name**, **input** **arguments**, and **returns** a data type. | ||
|
||
::: callout-tip | ||
## Execution rule for functions: | ||
|
||
A function's input arguments, when there's more than one, can be specified by: | ||
|
||
- The order the input given: `pow(2, 3)` is different than `pow(3, 2)`. | ||
|
||
- The name of the input argument: `pow(base=2, exp=3)`. | ||
|
||
If the arguments contain expressions, evaluate those expressions first! | ||
::: | ||
|
||
## Examples | ||
|
||
```{python} | ||
pow(2, 3) | ||
``` | ||
|
||
```{python} | ||
pow(base=2, exp=3) | ||
``` | ||
|
||
```{python} | ||
pow(exp=3, base=2) | ||
``` | ||
|
||
. . . | ||
|
||
```{python} | ||
max(len("hello"), 4) | ||
``` | ||
|
||
## Learning a new function | ||
|
||
1. Function documentation | ||
|
||
``` | ||
?pow | ||
pow(base, exp, mod=None) | ||
Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments | ||
Some types, such as ints, are able to use a more efficient algorithm when | ||
invoked using the three argument form. | ||
``` | ||
|
||
. . . | ||
|
||
2. Documents page of a Python Module | ||
|
||
[Base Python documentation of `pow`](https://docs.python.org/3/library/functions.html#pow) | ||
|
||
. . . | ||
|
||
3. Forums vetted by experts, such as [SlackOverflow](https://stackoverflow.com/questions/tagged/pow+python) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.