Convert String to Title Case

Another example of converting to title case using string methods.

BeginnerTopic: String Programs
Back

Python Convert String to Title Case Program

This program helps you to learn the fundamental structure and syntax of Python programming.

Try This Code
# Program to convert string to title case

s = input("Enter a sentence: ")

print("Title case:", s.title())
Output
Enter a sentence: python STRING programs
Title case: Python String Programs

Understanding Convert String to Title Case

Demonstrates reusing .title() directly on user input.

Note: To write and run Python programs, you need to set up the local environment on your computer. Refer to the complete article Setting up Python Development Environment. If you do not want to set up the local environment on your computer, you can also use online IDE to write and run your Python programs.

Table of Contents