{"id":24442,"date":"2021-10-17T18:33:41","date_gmt":"2021-10-17T13:03:41","guid":{"rendered":"https:\/\/python-programs.com\/?p=24442"},"modified":"2021-11-05T19:23:37","modified_gmt":"2021-11-05T13:53:37","slug":"program-for-python-string-capitalize-function","status":"publish","type":"post","link":"https:\/\/python-programs.com\/program-for-python-string-capitalize-function\/","title":{"rendered":"Program for Python String capitalize() Function"},"content":{"rendered":"

In the previous article, we have discussed Python Program for hypot() Function<\/a>
\ncapitalize() Function in Python:<\/strong><\/p>\n

The capitalize() method returns a string in which the first character is upper case and the remaining characters are lower case.<\/p>\n

Non-letters are not capitalized by the string capitalize function.<\/p>\n

Syntax:<\/strong><\/p>\n

string.capitalize()<\/pre>\n

Parameters:<\/strong> This function doesn’t have any parameters.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first string = \"hello this is BTECHGEEKS\"\r\nGiven second string = \"10345 good morning btechgeeks\"<\/pre>\n

Output:<\/strong><\/p>\n

The above given first string is : hello this is BTECHGEEKS\r\nThe given first string after applying capitalize() function: Hello this is btechgeeks\r\nThe above given second string is : 10345 good morning btechgeeks\r\nThe given second string after applying capitalize() function: 10345 good morning btechgeeks<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first string = \"heLLO 1256 GOOd MOrning\"\r\nGiven second string = \"Hello btech137GEEKS\"<\/pre>\n

Output:<\/strong><\/p>\n

The above given first string is : heLLO 1256 GOOd MOrning\r\nThe given first string after applying capitalize() function: Hello 1256 good morning\r\nThe above given second string is : Hello btech137GEEKS\r\nThe given second string after applying capitalize() function: Hello btech137geeks<\/pre>\n

Program for capitalize() Function in Python<\/h2>\n