diff --git a/snippets/all_unique.md b/snippets/all_unique.md index ac0fb0302..5e523c93d 100644 --- a/snippets/all_unique.md +++ b/snippets/all_unique.md @@ -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 diff --git a/snippets/daterange.md b/snippets/daterange.md index d4f6e6971..56c4d3429 100644 --- a/snippets/daterange.md +++ b/snippets/daterange.md @@ -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. @@ -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)] ``` diff --git a/snippets/from_iso_date.md b/snippets/from_iso_date.md index fa4b6ed6c..d43d85c6f 100644 --- a/snippets/from_iso_date.md +++ b/snippets/from_iso_date.md @@ -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. diff --git a/snippets/is_contained_in.md b/snippets/is_contained_in.md index d19f9d244..6db48c412 100644 --- a/snippets/is_contained_in.md +++ b/snippets/is_contained_in.md @@ -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 diff --git a/snippets/to_iso_date.md b/snippets/to_iso_date.md index 2caff6055..af6f7ac9e 100644 --- a/snippets/to_iso_date.md +++ b/snippets/to_iso_date.md @@ -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.