Python Programming Challenge #3 - Converting File Names to Headlines
Filename to Headline Conversion
1
Strip the Extension
filename.rsplit('.', 1)[0] removes .pdf, .docx, etc.
2
Replace Separators
.replace('_', ' ').replace('-', ' ') — get word boundaries.
3
Title Case
.title() capitalizes the first letter of each word.
4
Fix Edge Cases
Lowercase short words like 'and', 'of', 'the' for proper headline style.
Master Python at Noble Desktop
Noble Desktop's Python Programming Immersive covers AI APIs, data analysis, and modern Python development.
Are you looking for a new coding challenge? Test your Python programming skills by trying to convert file names into headlines!
Starting File
Final File