Fix typos
This commit is contained in:
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user