79377274

Date: 2025-01-22 10:11:19
Score: 0.5
Natty:
Report link
  1. Use a regular expression
  2. Find the first word-class character
  3. Uppercase it
>>> import re
>>> s = "\n\n\n\n first letter is to be capital"
>>> re.sub(r"\w", lambda a: a.group().upper(), s, 1)
'\n\n\n\n First letter is to be capital'
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Shaheed Haque