November 2017
Intermediate to advanced
266 pages
5h 34m
English
There are multiple ways to convert an IPv4 address to an IPv6 address. In Python 3, we have the inbuilt ipaddress module:
import ipaddressdef convertusingipaddress(ipv4address): print(ipaddress.IPv6Address('2002::' + ipv4address).compressed)convertusingipaddress("10.10.10.10")convertusingipaddress("192.168.100.1")
The output for the preceding code is as follows:

Read now
Unlock full access