Editor settings

General settings

Save settings

Learn to program with Python

Convert sentence to title case #

Write a function that takes a sentence as input and converts it to title case. In title case, the first letter of each word is capitalized, while the remaining letters are lowercase.

We recommend that you do not use the title() method for this challenge and try to solve the problem on your own.

Tests #

  • convert_to_title("hello world!") should return "Hello World!"
  • convert_to_title("the cat in the hat.") should return "The Cat In The Hat."
  • convert_to_title("i love coding.") should return "I Love Coding."
  • convert_to_title("this is a test sentence.") should return "This Is A Test Sentence."
  • convert_to_title("the quick brown fox.") should return "The Quick Brown Fox."
  • convert_to_title("PYTHON PROGRAMMING IS FUN!") should return "Python Programming Is Fun!"
Output will be displayed here