how to create a network scanner in python

import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

target = input('What website to scan?: ')

Here is what the above code is Doing:
1. We’re creating a socket object.
2. We’re storing the website we want to scan in a variable.
3. We’re storing the starting port in a variable.
4. We’re storing the ending port in a variable.