To make the first letter of a string lowercase in python, you can use the lower()
method in combination with string slicing. Here's an example:
main.py123 chars4 lines
Alternatively, you can use the capitalize()
method to capitalize the first letter of a string and convert the rest of the string to lowercase:
main.py109 chars4 lines
Note that the upper()
method can also be used to capitalize the first letter in a string, but it will also convert the rest of the string to uppercase:
main.py202 chars7 lines
gistlibby LogSnag