explain capitalize() function with suitable example
Answers
Answered by
0
Answer:
here is your answer mate !!
Explanation:
The capitalize() method returns a string where the first character is upper case.
Answered by
0
Answer:
In Python, the capitalize() method converts first character of a string to uppercase letter and lowercases all other characters, if any.
Explanation:
The syntax of capitalize() is:
string.capitalize()
The capitalize() function returns a string with the first letter capitalized and all other characters lowercased. It doesn't modify the original string.
Example 1: Capitalize a Sentence
string = "python is AWesome."
capitalized_string = string.capitalize()
print('Old String: ', string)
print('Capitalized String:', capitalized_string)
Output
Old String: python is AWesome
Capitalized String: Python is awesome
Similar questions
Math,
1 month ago
English,
1 month ago
Political Science,
3 months ago
Political Science,
3 months ago
Math,
9 months ago
Math,
9 months ago
English,
9 months ago