SyntaxFix
Write A Post
Hire A Developer
Questions
You can replace the first letter (preceded by a digit) of each word using regex:
preceded by a digit
re.sub(r'(\d\w)', lambda w: w.group().upper(), '1bob 5sandy') output: 1Bob 5Sandy