First Word (simplified)

First Word (simplified)

You are given a string and you have to find its first word.

  • The input string consists of only English letters and spaces.
  • There aren’t any spaces at the beginning and the end of the string.

example

Input: A string (str).

Output: A string (str).

Examples:

assert first_word("Hello world") == "Hello"
assert first_word("a word") == "a"
assert first_word("greeting from CheckiO Planet") == "greeting"
assert first_word("hi") == "hi"

How it is used: The first word is a command in a command line.

Precondition: The text can contain a-z, A-Z and spaces.

40