Blog

Python: Comprehensions

Comprehensions build data structures with one or more iterator. This approach reduces syntax when building lists, dictionaries, or sets from conditional and loop statements. Build a list with a list comprehension import string alphabet = string.ascii_lowercase alphabet_list = [letter for letter in alphabet] print(alphabet_list) Build a dictionary with a dictionary comprehension import string...

Python: A Primer on Lists

Python lists can convert other data types to lists. They can be separated into single values with offset and split or groups of items (slices) with extract. An empty pair of square brackets creates an empty list empty_list = [] Or with the list() function empty_list = list() Convert a string list_from_string = list('triangle') Convert a tuple our_tuple = ('ready', 'set', 'go') list_from_tuple...

Nontraditional Investments: Lego Sets

Lego sets outperform gold, art, and equities with an average return of 11% YoY. I began buying iconic Lego sets with the long-term aim of earning a return on investment. I’ll document my journey while comparing these results to those of my traditional investments. NameItemQuantityMSRPPurchasedCentral Perk213191$59.9912/2021The Friends Apartments102921$149.99 12/2021 Ross Keyring8541171$5.99...