seattlecitylight-mastodon-bot/posttext.py
Liam Steckler 940c626bbe
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/vulnerability-scan Pipeline was successful
ci/woodpecker/push/docker-buildx Pipeline was successful
Format the list of updated properties into a nicer sentence
2025-07-10 12:56:38 -07:00

11 lines
277 B
Python

from collections.abc import Sequence
def list_to_sentence(list: Sequence[str]) -> str:
match len(list):
case 0:
return str()
case 1:
return list[0]
case _:
return " and ".join((", ".join(list[0:-1]), list[-1]))