Update snippet titles

This commit is contained in:
Isabelle Viktoria Maciohsek
2022-02-13 14:18:08 +02:00
parent 18a8c6cfbc
commit b3b60cd838
30 changed files with 36 additions and 36 deletions

View File

@ -1,5 +1,5 @@
--- ---
title: invert_dictionary title: Invert dictionary
tags: dictionary,intermediate tags: dictionary,intermediate
firstSeen: 2020-04-07T21:13:32+03:00 firstSeen: 2020-04-07T21:13:32+03:00
lastUpdated: 2020-11-02T19:28:05+02:00 lastUpdated: 2020-11-02T19:28:05+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: is_anagram title: String is anagram
tags: string,intermediate tags: string,intermediate
firstSeen: 2018-10-01T13:17:29+03:00 firstSeen: 2018-10-01T13:17:29+03:00
lastUpdated: 2020-11-02T19:28:05+02:00 lastUpdated: 2020-11-02T19:28:05+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: is_contained_in title: List is contained in other list
tags: list,intermediate tags: list,intermediate
firstSeen: 2020-03-16T19:48:15+02:00 firstSeen: 2020-03-16T19:48:15+02:00
lastUpdated: 2021-01-07T23:30:28+02:00 lastUpdated: 2021-01-07T23:30:28+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: is_divisible title: Number is divisible
tags: math,beginner tags: math,beginner
unlisted: true unlisted: true
firstSeen: 2019-08-20T14:19:55+03:00 firstSeen: 2019-08-20T14:19:55+03:00

View File

@ -1,5 +1,5 @@
--- ---
title: is_even title: Number is even
tags: math,beginner tags: math,beginner
unlisted: true unlisted: true
firstSeen: 2019-08-20T14:21:44+03:00 firstSeen: 2019-08-20T14:21:44+03:00

View File

@ -1,5 +1,5 @@
--- ---
title: is_odd title: Number is odd
tags: math,beginner tags: math,beginner
unlisted: true unlisted: true
firstSeen: 2019-08-20T14:21:44+03:00 firstSeen: 2019-08-20T14:21:44+03:00

View File

@ -1,5 +1,5 @@
--- ---
title: is_prime title: Number is prime
tags: math,intermediate tags: math,intermediate
firstSeen: 2020-10-03T18:03:32+03:00 firstSeen: 2020-10-03T18:03:32+03:00
lastUpdated: 2020-11-02T19:28:05+02:00 lastUpdated: 2020-11-02T19:28:05+02:00
@ -15,7 +15,7 @@ Checks if the provided integer is a prime number.
from math import sqrt from math import sqrt
def is_prime(n): def is_prime(n):
if n <= 1 or (n % 2 == 0 and n > 2): if n <= 1 or (n % 2 == 0 and n > 2):
return False return False
return all(n % i for i in range(3, int(sqrt(n)) + 1, 2)) return all(n % i for i in range(3, int(sqrt(n)) + 1, 2))
``` ```

View File

@ -1,5 +1,5 @@
--- ---
title: is_weekday title: Date is weekday
tags: date,beginner tags: date,beginner
firstSeen: 2020-10-28T16:20:18+02:00 firstSeen: 2020-10-28T16:20:18+02:00
lastUpdated: 2020-11-02T19:28:05+02:00 lastUpdated: 2020-11-02T19:28:05+02:00
@ -15,7 +15,7 @@ Checks if the given date is a weekday.
from datetime import datetime from datetime import datetime
def is_weekday(d = datetime.today()): def is_weekday(d = datetime.today()):
return d.weekday() <= 4 return d.weekday() <= 4
``` ```
```py ```py

View File

@ -1,5 +1,5 @@
--- ---
title: is_weekend title: Date is weekend
tags: date,beginner tags: date,beginner
firstSeen: 2020-10-28T16:20:27+02:00 firstSeen: 2020-10-28T16:20:27+02:00
lastUpdated: 2020-11-02T19:28:05+02:00 lastUpdated: 2020-11-02T19:28:05+02:00
@ -15,7 +15,7 @@ Checks if the given date is a weekend.
from datetime import datetime from datetime import datetime
def is_weekend(d = datetime.today()): def is_weekend(d = datetime.today()):
return d.weekday() > 4 return d.weekday() > 4
``` ```
```py ```py

View File

@ -1,5 +1,5 @@
--- ---
title: kebab title: Kebabcase string
tags: string,regexp,intermediate tags: string,regexp,intermediate
firstSeen: 2019-08-21T08:59:54+03:00 firstSeen: 2019-08-21T08:59:54+03:00
lastUpdated: 2020-11-02T19:28:05+02:00 lastUpdated: 2020-11-02T19:28:05+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: key_in_dict title: Key in dictionary
tags: dictionary,beginner tags: dictionary,beginner
firstSeen: 2020-10-16T21:30:49+03:00 firstSeen: 2020-10-16T21:30:49+03:00
lastUpdated: 2020-10-16T21:30:49+03:00 lastUpdated: 2020-10-16T21:30:49+03:00

View File

@ -1,5 +1,5 @@
--- ---
title: key_of_max title: Key of max value
tags: dictionary,beginner tags: dictionary,beginner
firstSeen: 2021-01-07T23:15:48+02:00 firstSeen: 2021-01-07T23:15:48+02:00
lastUpdated: 2021-01-07T23:15:48+02:00 lastUpdated: 2021-01-07T23:15:48+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: key_of_min title: Key of min value
tags: dictionary,beginner tags: dictionary,beginner
firstSeen: 2021-01-07T23:15:48+02:00 firstSeen: 2021-01-07T23:15:48+02:00
lastUpdated: 2021-01-07T23:15:48+02:00 lastUpdated: 2021-01-07T23:15:48+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: keys_only title: Dictionary keys
tags: dictionary,list,beginner tags: dictionary,list,beginner
firstSeen: 2018-04-01T23:56:31+03:00 firstSeen: 2018-04-01T23:56:31+03:00
lastUpdated: 2020-11-02T19:28:05+02:00 lastUpdated: 2020-11-02T19:28:05+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: km_to_miles title: Km to miles
tags: math,beginner tags: math,beginner
unlisted: true unlisted: true
firstSeen: 2020-10-04T00:23:49+03:00 firstSeen: 2020-10-04T00:23:49+03:00

View File

@ -1,5 +1,5 @@
--- ---
title: last title: Last list element
tags: list,beginner tags: list,beginner
firstSeen: 2019-08-20T15:11:47+03:00 firstSeen: 2019-08-20T15:11:47+03:00
lastUpdated: 2020-11-02T19:28:05+02:00 lastUpdated: 2020-11-02T19:28:05+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: lcm title: Least common multiple
tags: math,list,intermediate tags: math,list,intermediate
firstSeen: 2018-01-08T22:30:17+02:00 firstSeen: 2018-01-08T22:30:17+02:00
lastUpdated: 2020-11-02T19:31:15+02:00 lastUpdated: 2020-11-02T19:31:15+02:00

View File

@ -1,11 +1,11 @@
--- ---
title: longest_item title: Longest item
tags: list,string,intermediate tags: list,string,intermediate
firstSeen: 2019-08-20T15:27:49+03:00 firstSeen: 2019-08-20T15:27:49+03:00
lastUpdated: 2021-10-17T18:24:43+02:00 lastUpdated: 2021-10-17T18:24:43+02:00
--- ---
Takes any number of iterable objects or objects with a length property and returns the longest one. Takes any number of iterable objects or objects with a length property and returns the longest one.
- Use `max()` with `len()` as the `key` to return the item with the greatest length. - Use `max()` with `len()` as the `key` to return the item with the greatest length.
- If multiple items have the same length, the first one will be returned. - If multiple items have the same length, the first one will be returned.

View File

@ -1,5 +1,5 @@
--- ---
title: map_dictionary title: Map list to dictionary
tags: list,dictionary,intermediate tags: list,dictionary,intermediate
firstSeen: 2020-04-07T19:53:48+03:00 firstSeen: 2020-04-07T19:53:48+03:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: map_values title: Map dictionary values
tags: dictionary,intermediate tags: dictionary,intermediate
firstSeen: 2019-08-20T15:34:30+03:00 firstSeen: 2019-08-20T15:34:30+03:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: max_by title: Max list value based on function
tags: math,list,beginner tags: math,list,beginner
firstSeen: 2019-08-20T15:42:41+03:00 firstSeen: 2019-08-20T15:42:41+03:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: max_element_index title: Index of max element
tags: math,list,beginner tags: math,list,beginner
firstSeen: 2019-10-31T09:42:21+02:00 firstSeen: 2019-10-31T09:42:21+02:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00

View File

@ -1,11 +1,11 @@
--- ---
title: max_n title: N max elements
tags: list,math,beginner tags: list,math,beginner
firstSeen: 2018-01-19T11:25:28+02:00 firstSeen: 2018-01-19T11:25:28+02:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00
--- ---
Returns the `n` maximum elements from the provided list. Returns the `n` maximum elements from the provided list.
- Use `sorted()` to sort the list. - Use `sorted()` to sort the list.
- Use slice notation to get the specified number of elements. - Use slice notation to get the specified number of elements.

View File

@ -1,5 +1,5 @@
--- ---
title: median title: Median
tags: math,beginner tags: math,beginner
firstSeen: 2019-10-03T12:02:17+03:00 firstSeen: 2019-10-03T12:02:17+03:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: merge title: Merge lists
tags: list,advanced tags: list,advanced
firstSeen: 2020-04-13T19:09:12+03:00 firstSeen: 2020-04-13T19:09:12+03:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: merge_dictionaries title: Merge dictionaries
tags: dictionary,intermediate tags: dictionary,intermediate
firstSeen: 2020-04-16T19:28:35+03:00 firstSeen: 2020-04-16T19:28:35+03:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: miles_to_km title: Miles to km
tags: math,beginner tags: math,beginner
unlisted: true unlisted: true
firstSeen: 2020-10-04T00:24:01+03:00 firstSeen: 2020-10-04T00:24:01+03:00

View File

@ -1,5 +1,5 @@
--- ---
title: min_by title: Min list value based on function
tags: math,list,beginner tags: math,list,beginner
firstSeen: 2019-08-20T15:42:41+03:00 firstSeen: 2019-08-20T15:42:41+03:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00

View File

@ -1,5 +1,5 @@
--- ---
title: min_element_index title: Index of min element
tags: math,list,beginner tags: math,list,beginner
firstSeen: 2020-10-05T22:32:00+03:00 firstSeen: 2020-10-05T22:32:00+03:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00

View File

@ -1,11 +1,11 @@
--- ---
title: min_n title: N min elements
tags: list,math,beginner tags: list,math,beginner
firstSeen: 2018-01-19T11:25:28+02:00 firstSeen: 2018-01-19T11:25:28+02:00
lastUpdated: 2020-11-02T19:28:27+02:00 lastUpdated: 2020-11-02T19:28:27+02:00
--- ---
Returns the `n` minimum elements from the provided list. Returns the `n` minimum elements from the provided list.
- Use `sorted()` to sort the list. - Use `sorted()` to sort the list.
- Use slice notation to get the specified number of elements. - Use slice notation to get the specified number of elements.