day01 package
Subpackages
Submodules
day01.day1a module
day1a solution.
- day01.day1a.get_first_last(line: str) tuple[str, str] [source]
Returns first and last numeric character of a string.
It can be the same character.
- Parameters:
line (str) – string to parse
- Raises:
ValueError – When there are no numbers in the string
- Returns:
first char, last char
- Return type:
tuple[str, str]
day01.day1b module
day1b solution.
- class day01.day1b.IndexValue(index: int = 0, value: str = '1')[source]
Bases:
object
index to value mapping.
- index: int = 0
- value: str = '1'
- class day01.day1b.WordNumber(word: str = 'one', number: str = '1')[source]
Bases:
object
Simple mapping from word to integer.
- number: str = '1'
- word: str = 'one'
- day01.day1b.get_input(input_file: str) list[str] [source]
Opens a file and returns a list of strings to handle.
- Parameters:
input_file (str) – filepath of input
- Returns:
list of strings to parse
- Return type:
list[str]
Module contents
day01 package.