Instruction
Excellent. Only two more questions left!
Exercise
Ask the user for a list of file names separated with semicolons:
Please provide some text:
Your task is to print a new list according to the following rules:
- Change all letters to lowercase.
- Get rid of leading and trailing spaces in the file names.
- If a file name contains spaces in the middle, turn them into underscores (
_). - Add a four-digit number and a hyphen in front of the name. Start the counter at 1.
- Print each file name on a new line.
Example input:
preview.EXE;Bali.jpg; important list.doc
Expected output:
0001-preview.exe 0002-bali.jpg 0003-important_list.doc
Stuck? Here's a hint!
Use the split(), strip(), lower(), replace(), and format() functions.



