1# Python 3 has a std lib
2# module for working with
3# IP addresses:
4
5>>> import ipaddress
6
7>>> ipaddress.ip_address('192.168.1.2')
8IPv4Address('192.168.1.2')
9
10>>> ipaddress.ip_address('2001:af3::')
11IPv6Address('2001:af3::')
12
13# Learn more here:
14# https://docs.python.org/3/library/ipaddress.html