Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions data/part-4/3-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Notice how the method modifies the list itself. Sometimes we don't want to chang

```python
my_list = [2,5,1,2,4]
print(sorted(my_list)))
print(sorted(my_list))
```

<sample-output>
Expand Down Expand Up @@ -494,17 +494,17 @@ Some _functions_ are happy to take a list as an argument. Above we saw the funct
my_list = [3, 2, 7, 1]

# function calls take the list as an argument
greatest = max(my_list))
smallest = min(my_list))
length = len(my_list))
greatest = max(my_list)
smallest = min(my_list)
length = len(my_list)

print("Smallest:", smallest)
print("Greatest:", greatest)
print("Length of the list:", length)

# another function call
# the list itself is an argument, the function returns a sorted copy
in_order = sorted(my_list))
in_order = sorted(my_list)
print(in_order)
```

Expand All @@ -523,7 +523,7 @@ Just like the built-in functions above, our own functions can also take a list a

```python
def median(my_list: list):
ordered = sorted(my_list))
ordered = sorted(my_list)
list_centre = len(ordered) // 2
return ordered[list_centre]
```
Expand Down Expand Up @@ -652,7 +652,7 @@ Please write a function named `mean`, which takes a list of integers as an argum

```python
my_list = [1, 2, 3, 4, 5]
result = mean(my_list))
result = mean(my_list)
print("mean value is", result)
```

Expand All @@ -671,7 +671,7 @@ Please write a function named `range_of_list`, which takes a list of integers a

```python
my_list = [1, 2, 3, 4, 5]
result = range_of_list(my_list))
result = range_of_list(my_list)
print("The range of the list is", result)
```

Expand Down