capitalize() All String methods
First char of input string is changed to Upper case.
We can't change the first char if it is a number
my_str="welcome to plus2net.com"
print(my_str.capitalize()) # Welcome to plus2net.com
my_str="345 is the number"
print(my_str.capitalize()) # 345 is the number
No parameter is taken by this method.
All String methods
Subscribe to our YouTube Channel here
This article is written by plus2net.com team.