Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinityyi committed Jan 7, 2021
1 parent be5357b commit 6169dda
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion snippets/all_unique.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tags: list,beginner

Checks if all the values in a list are unique.

- Use `set()` on the given list to keep only unique occurences.
- Use `set()` on the given list to keep only unique occurrences.
- Use `len()` to compare the length of the unique values to the original list.

```py
Expand Down
4 changes: 2 additions & 2 deletions snippets/daterange.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tags: date,intermediate

Creates a list of dates between `start` (inclusive) and `end` (not inclusive).

- Use `datetime.timedelta.days` to get the days betwen `start` and `end`.
- Use `datetime.timedelta.days` to get the days between `start` and `end`.
- Use `int()` to convert the result to an integer and `range()` to iterate over each day.
- Use a list comprehension and `datetime.timedelta()` to create a list of `datetime.date` objects.

Expand All @@ -19,6 +19,6 @@ def daterange(start, end):
```py
from datetime import date

daterange(date(2020, 10, 1), date(2020, 10, 5))
daterange(date(2020, 10, 1), date(2020, 10, 5))
# [date(2020, 10, 1), date(2020, 10, 2), date(2020, 10, 3), date(2020, 10, 4)]
```
2 changes: 1 addition & 1 deletion snippets/from_iso_date.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: from_iso_date
tags: date,intermediate
---

Converts a date from its ISO-8601 represenation.
Converts a date from its ISO-8601 representation.

- Use `datetime.datetime.fromisoformat()` to convert the given ISO-8601 date to a `datetime.datetime` object.

Expand Down
2 changes: 1 addition & 1 deletion snippets/is_contained_in.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tags: list,intermediate

Checks if the elements of the first list are contained in the second one regardless of order.

- Use `count()` to check if any value in `a` has more occurences than it has in `b`.
- Use `count()` to check if any value in `a` has more occurrences than it has in `b`.
- Return `False` if any such value is found, `True` otherwise.

```py
Expand Down
2 changes: 1 addition & 1 deletion snippets/to_iso_date.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: to_iso_date
tags: date,intermediate
---

Converts a date to its ISO-8601 represenation.
Converts a date to its ISO-8601 representation.

- Use `datetime.datetime.isoformat()` to convert the given `datetime.datetime` object to an ISO-8601 date.

Expand Down

0 comments on commit 6169dda

Please sign in to comment.