The capitalize() function turns the first letter of the string to uppercase and the other letters to lowercase.
#!/usr/bin/python3 # -*- coding: UTF-8 -*- str = "she is good at Math" print (str.capitalize()) str = " she likes watching TV" print (str.capitalize())
She is good at math she likes watching tv
The method doesn’t take any parameters.
It returns a string with the first letter capitalized and all other characters lowercased.