def handleargs(arglist):
 try:
  if (len(arglist) == 1):
   return (0, int(arglist[0]), 1)
  elif (len(arglist) == 2):
   return (int(arglist[0]), int(arglist[1]), 1)
  elif (len(arglist) == 3):
   if (arglist[2] == 0):
    raise ValueError('step argument must not be zero')
   return tuple((int(x) for x in arglist))
  else:
   raise TypeError('range() accepts 1-3 arguments, given', len(arglist))
 except TypeError:
  raise TypeError('range() arguments must be numbers or strings representing numbers')

def handleargs ( arglist ) : try : if ( len ( arglist ) == 1 ) : return ( 0 , int ( arglist [ 0 ] ) , 1 ) elif ( len ( arglist ) == 2 ) : return ( int ( arglist [ 0 ] ) , int ( arglist [ 1 ] ) , 1 ) elif ( len ( arglist ) == 3 ) : if ( arglist [ 2 ] == 0 ) : raise ValueError ( 'step argument must not be zero' ) return tuple ( ( int ( x ) for x in arglist ) ) else : raise TypeError ( 'range() accepts 1-3 arguments, given' , len ( arglist ) ) except TypeError : raise TypeError ( 'range() arguments must be numbers or strings representing numbers' )
take list of arguments and extract/create proper start .