def numToString(num, numDigits):
 if (not isinstance(num, int)):
  return ((-1), 'Bad number')
 strNum = str(num)
 if (numDigits < len(strNum)):
  return ((-1), 'Bad digit number')
 for i in range((numDigits - len(strNum))):
  strNum = ('0' + strNum)
 return (0, strNum)

def numToString ( num , numDigits ) : if ( not isinstance ( num , int ) ) : return ( ( - 1 ) , 'Bad number' ) strNum = str ( num ) if ( numDigits < len ( strNum ) ) : return ( ( - 1 ) , 'Bad digit number' ) for i in range ( ( numDigits - len ( strNum ) ) ) : strNum = ( '0' + strNum ) return ( 0 , strNum )
given a number returns its string format with the specified length .