def nonnegative_int(argument):
 value = int(argument)
 if (value < 0):
  raise ValueError('negative value; must be positive or zero')
 return value

def nonnegative_int ( argument ) : value = int ( argument ) if ( value < 0 ) : raise ValueError ( 'negative value; must be positive or zero' ) return value
check for a nonnegative integer argument; raise valueerror if not .