EasyStringsNot started

Dispatch message initials

A radio display abbreviates a dispatch phrase to the first letter of each word. Read a phrase containing one or more words and print its uppercase initials without spaces.

Input

One line containing 1 to 12 words separated by single spaces.

Output

One line containing the uppercase initials.

Example 1

Input

north harbour patrol

Output

NHP

The first letters of the three words are uppercased and joined.

Constraints

  • Every word contains 1 to 30 ASCII letters
  • The phrase has no leading or trailing spaces

Hints

Hint 1 of 3

split() produces a list of words.

Hint 2 of 3

word[0] selects a word's first character.

Hint 3 of 3

Uppercase and append that character inside a loop.

Solution

Show a reference solution and explanation
 Python · reference solution
words = input().split()
initials = ""
for word in words:
    initials += word[0].upper()
print(initials)

Why it works

Splitting defines the word boundaries, indexing selects each first character, and upper normalises the result. Building one output string avoids unwanted spaces between initials.

Lesson for this exercise: Strings in Python

Your program
words = input().split()
initials = ""
# collect one uppercase letter per word
print(initials)

Tests: 3 cases including the examples. Passing every test marks the exercise solved in this browser.

Ready for a challenge?

How this page was checked. Every program on it was run with CPython 3.11 at build time; runs in your browser on CPython 3.14 (Pyodide) by the publishing checks, and the output shown is what it printed. The Run buttons execute the same code on your device; nothing you type is sent anywhere.