Parse a file into a list of strings, separated by sep.
(filename, sep="\n")
| 205 | |
| 206 | |
| 207 | def from_file(filename, sep="\n"): |
| 208 | "Parse a file into a list of strings, separated by sep." |
| 209 | with open(filename) as file: |
| 210 | return file.read().strip().split(sep) |
| 211 | |
| 212 | |
| 213 | def random_puzzle(assignments=17): |