To deal with alert first we need to understand whats is an alert?Alerts are messages or popups that requires confirmation from users as shown below
Code for Alert in selenium:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
alert=wait.until(EC.alert_is_present())
alert.text
alert.accept()
Above code will accept the popup or alert.