Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Capitalize the first letter of each word in a string.

Medium

Problem Statement

Capitalize the first letter of each word in a string.

Sample Input

python is fun

Sample Output

Python Is Fun

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
def capitalize_words(): s = "python is fun" # Your code here return
Log in or sign up to run or submit your code.Log inSign up
Input
python is fun
Expected Output
Python Is Fun