Unit: Unit 4: Strings, Lists, and Tuples • Interactive Practice
Interactive Python programming tutorial and practice in your browser.
# Check for sensitive keywords and valid email format
email_address = "admin@internal.company.org"
message = "Please update your password before tomorrow."
# 1. Check if '@' and domain are present
has_at_symbol = "@" in email_address
is_internal_domain = "@internal.company.org" in email_address
# 2. Check for security alerts
contains_password = "password" in message
contains_credit_card = "credit card" not in message
print("Has @ symbol:", has_at_symbol)
print("Is internal domain:", is_internal_domain)
print("Contains 'password':", contains_password)
print("No credit card mentioned:", contains_credit_card)