The question says it all.
Context:
Imagine an URL route where I can type "Ping", press a button and the server answers "Pong" in pure Python 3?
You can create a connection like this:
# create an INET, STREAMing socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# now connect to the web server on port 80 - the normal http port
s.connect(("www.python.org", 80))
Also you can get more information in the documentation.