LearnPy Hub
← Exceptions problems
Easy

First Word or Empty

Read a line and print its first word. If the line has no words, split()[0] raises IndexError: catch it and print (empty).

Input

One line (it may be only spaces).

Output

One line.

Sample 1

Input
hello world
Output
hello

Sample 2

Input
   
Output
(empty)
solution.py
Output appears here
First Word or Empty · Python practice problem · LearnPy Hub