Hi, I’m Erika Rowland (a.k.a. erikareads). Hi, I’m Erika. I’m an Ops-shaped Software Engineer, Toolmaker, and Resilience Engineering fan. I like Elixir and Gleam, Reading, and Design. She/Her. Constellation Webring Published on

python3

Pattern Matching

Python added pattern matching, which works like this:Pattern matching became available in Python 3.10

match my_list:
  case []:
    print("empty list")
  case [item]:
    print(item)
  case [*items]:
    print(items)
  case _:
    print("default case")

Constellation Webring