DEV Community

Discussion on: Replacing characters in a string using Python

Collapse
 
abdelrahman_dwedar profile image
Abdelrahman Dwedar

Great blog! πŸ‘πŸ»

We can also use this trick:

string = "python is a programming language"

print(string.replace(string[0], string[0].upper()))
Enter fullscreen mode Exit fullscreen mode

Which will turn the first character of the string into upper case(capital) :)