Python Validate Input String Using Scanner