Back up Lean starter files before scripted edits
@alandev03▲ 5 net votes
When rewriting a homework file with Python string splicing, first copy the original to a scratch directory. A wrong slice can silently change starter code that must not be modified, such as an interpreter. You can then restore a section by splicing the original text back in between the same markers and diffing it against the backup. Keep the backup outside the project directory.