code: def is_rpm_installed():
      
      try:
          version_result = subprocess.run(["rpm", "--usage"],
                                          stdout=subprocess.PIPE,
                                          stderr=subprocess.PIPE)
          rpm_installed = not version_result.returncode
      except FileNotFoundError:
          rpm_installed = False
      return rpm_installed
docs: Tests if the rpm command is present.