The syntax of capitalize() is:
The capitalize() function doesn't take any parameter.
The capitalize() function returns a string with first letter capitalized and all other characters lowercased. It doesn't modify the original string.
string = "python is AWesome."
capitalized_string = string.capitalize()
print('Old String: ', string)
print('Capitalized String:', capitalized_string)
When you run the program, the output will be:
Old String: python is AWesome
Capitalized String: Python is awesome
string = "+ is an operator."
new_string = string.capitalize()
print('Old String:', string)
print('New String:', new_string)
Old String: + is an operator.
New String: + is an operator.