Posts in 2021
-
10-06 Graph
Wednesday, October 06, 2021 in Daily
Default Dictionary Sometimes you want to have a “default value” in a dictionary. The default value is returned whenever you ask for the value of a key that is not in the dictionary. A typical use would be counting words, where the count …
-
09-21
Friday, September 17, 2021 in Daily
Reading You need to convert strings to numbers with the int function. Read a single number: int(input()) Read a list of numbers: [int(n) for n in input().split()] If different items in the list have different meanings, it can be useful to give them …
-
09-14
Friday, September 10, 2021 in Daily
Ongoing topics Print vs return Mutation functions do not return values. Also: Why does append return None? Examples: append, extend. The Python boss post on the topic is short and informative. Copy vs in-place: sorted(data) vs data.sort(). Upcoming …