code: def which(executable):
      
      locations = (
          '/usr/local/bin',
          '/bin',
          '/usr/bin',
          '/usr/local/sbin',
          '/usr/sbin',
          '/sbin',
      )
  
      for location in locations:
          executable_path = os.path.join(location, executable)
          if os.path.exists(executable_path) and os.path.isfile(executable_path):
              return executable_path
docs: find the location of an executable