LearnPy Hub
← Exceptions problems
Easy

Raise for an Empty Name

Write set_name(s) that raises ValueError('name is empty') when s has no characters after strip(), otherwise returns s stripped. Read a line and print the result or the error message.

Input

One line.

Output

One line.

Sample 1

Input
  Mim  
Output
Mim

Sample 2

Input
   
Output
name is empty
solution.py
Output appears here
Raise for an Empty Name · Python practice problem · LearnPy Hub