# Function to gather system information

def get_system_info():

try:

     hostname = socket.gethostname()

     local_ip = socket.gethostbyname(hostname)

        public_ip = requests.get("https://api64.ipify.org?format=json").json().get("ip", "Unavailable")

mac = ':'.join(['{:02x}'.format((uuid.getnode() >> i) & 0xff)for i in range(0, 8 * 6, 8)][::-1])

     system = platform.system()

     release = platform.release()

     version = platform.version()

        architecture = platform.architecture()[0]

        processor = platform.processor()

     return f"""

     System Number/ID: {system_number}

        Hostname: {hostname}

     Local IP Address: {local_ip}

     Public IP Address: {public_ip}

     MAC Address: {mac}

        Operating System: {system} {release}

     OS Version: {version}

        Architecture: {architecture}

        Processor: {processor}

        """

except Exception as e:

     return f"Error retrieving system info: {str(e)}"

 

Explanation:

       This Python function, get_system_info, retrieves and displays various details about the computer's system and network configuration. Here's a brief explanation of its components: