number_lines(text) that takes a multi-line string text (lines separated by \n) and returns a new string where each line is prefixed with its 1-based line number and a period, e.g. "1. first line". Lines are joined back together with \n.number_lines("apple\nbanana")'1. apple\n2. banana'
Two lines, each numbered.
number_lines("solo")'1. solo'
Single line still gets numbered.
`text.split("\n")` gives the individual lines.
Use enumerate(lines, start=1) to number them, then "\n".join(...).