Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. class ShortInputException(Exception): def __init__(self, length, atleast):
  2.         Exception.__init__(self)
  3.         self.length = length
  4.         self.atleast = atleast
  5. try:
  6. text = input() if len(text) < 3:
  7. raise ShortInputException(len(text), 3) # Other work can continue as usual here
  8. except EOFError:
  9. print()
  10. except ShortInputException as ex:
  11. print(\
  12. .format(ex.length, ex.atleast)) else:
  13. print()