import socket

srv = [
("10.20.20.1",1433),
("10.30.30.2",1521),
("10.30.30.3",80),
("10.20.20.4",443)]

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


for location in srv:
    result_of_check = a_socket.connect_ex(location)
    if result_of_check == 0:
        print("Port is open")
    else:
        print("Port is not open")
    a_socket.close()