r/pythonhelp • u/LurkerFinallyJoins • Mar 07 '21
Capitalization Python: noob question
Hi, thanks for ur help in advance.
I have a string "I like cats and dogs and monkeys".
And I have a function that changes it to this:
"i like cats
and dogs and
monkeys."
How do I get it so the first letter of each line is capitalized? thanks
3
Upvotes
1
u/socal_nerdtastic Mar 07 '21
That depends on your function.
For a single string you would use the capitalize method: