import socket def get_ipv4_address(): try: hostname = socket.gethostname() local_ip = socket.gethostbyname(hostname) return local_ip except Exception as e: return f'Error {e}' print(f'My IPv4 Address is : {get_ipv4_address()}')
import socket def get_ipv4_address(): try: hostname = socket.gethostname() local_ip = socket.gethostbyname(hostname) return local_ip except Exception as e: return f'Error {e}' print(f'My IPv4 Address is : {get_ipv4_address()}')