Python: Decapitalize the first letter of a given string
Decapitalize first letter in string.
Write a Python program to decapitalize the first letter of a given string.
- Use list slicing and str.lower() to decapitalize the first letter of the string.
- Use str.join() to combine the lowercase first letter with the rest of the characters.
- Omit the upper_rest parameter to keep the rest of the string intact, or set it to True to convert to uppercase.
Sample Solution:
Python Code:
Sample Output:
java Script python
Flowchart:

For more Practice: Solve these Related Problems:
- Write a Python program to change the first character of a string to lowercase while leaving the rest unchanged.
- Write a Python program to use slicing and the lower() method to decapitalize only the first letter of a string.
- Write a Python program to implement a function that returns a new string with the first character converted to lowercase.
- Write a Python program to handle empty strings and strings of one character when decapitalizing the first letter.
Go to:
Previous: Write a Python program to convert a given string to snake case.
Next: Write a Python program to split a given multiline string into a list of lines.
Python Code Editor:
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.