python
dz / pythonSummary
stuff about python
Subgraphs
Node Tree
- boolean_value_coercion
- double_colon_operator
- heapsort_examples
- repeat_strings
- timsort
- walrus_operator
Nodes
walrus_operator | |
content | the walrus operator |
remarks | this came up while looking up how to parse a file line-by-line in python. |
hyperlink | https://docs.python.org/3/whatsnew/3.8.html#assignment-expressions |
timsort | |
content | Timsort: the underlying algorithm used by Python for =sort= and =sorted=. |
remarks | Found via Fluent Python, via EV |
hyperlink | https://en.wikipedia.org/wiki/Timsort |
heapsort_examples | |
content | heapsort examples |
hyperlink | https://docs.python.org/3/library/heapq.html#basic-examples |
double_colon_reverse | |
content | x[::-1] can be used to reverse items in a list |
parents | double_colon_operator, leetcode/problems/125_valid_palindrome |
double_colon_operator | |
content | double colon operator: x[start:stop:step] |
children | double_colon_reverse |
parents | docs/stdtypes/common_sequence_ops |
repeat_strings | |
content | x = "hello", x*3 would be "hellohellohello" |
parents | leetcode/problems/1071_GCD_of_strings |
boolean_value_coercion | |
content | Boolean values can be coerced to ints using int(). int(True) is 1, int(False) is 0. |
parents | leetcode/problems/1456_max_vowels_in_substring, javascript/coercion |