Python String capitalize() Method
The capitalize() method converts the first character of a string to an uppercase letter and all other alphabets to lowercase. For example:
sentence = "i love PYTHON"
# converts first character to uppercase and others to lowercase
capitalized_string = sentence.capitalize()
print(capitalized_string) # Output: I love python
If you have any questions about this code, you can drop a line in comment.
Comments
Post a Comment