import requests
proxies_list = [твои прокси]
for proxy_ip in proxies_list:
proxies = {
"http": proxy_ip,
"https": proxy_ip
}
headers = {}
url = "https://yandex.ru"
try:
response = requests.head(
url=url,
headers=headers,
proxies=proxies,
timeout=10)
# делай что-то с response
except Exception as err:
print("Proxy - {}, Err - {}".format(proxy_ip, err))