Tell us what’s happening:
What are my not doing right on this code? I thought i got the settings but it’s coming back as not right.
Your code so far
email = 'alice.johnson@company.com'
print(f'Email: {email}')
at_position = email.find('@')
print(f'Position of @: {at_position}')
username = email[:at_position]
print(f'Username: {username}')
has_at = '@' in email
print(f'Has @ symbol: {has_at}')
has_com = '.com' in email
print(f'Has .com: {has_com}')
messy_name = ' sARaH dAVis '
print(f"Original name: '{messy_name}'")
clean_name = messy_name.strip().title()
print(f"Cleaned name: '{clean_name}'")
messy_email = ' SARAH.DAVIS@COMPANY.COM '
clean_email = messy_email.strip().lower()
print(f"Original email: '{messy_email}'")
print(f"Cleaned email: '{clean_email}'")
name_badge = clean_name.upper()
print(f'Name badge: {name_badge}')
at_pos = clean_email.find('@')
email_user = clean_email[:at_pos]
print(f'Email: {clean_email}')
print(f'Username: {email_user}')
display_name = email_user.replace('.', ' ').title()
print(f'Display name: {display_name}')
phone = '123-456-7890'
phone_clean = phone.replace('-', '')
print(f'Phone with dashes: {phone}')
print(f'Phone without dashes: {phone_clean}')
full_address = '123 Main Street, Springfield, IL'
address_parts = full_address.split(', ')
print(f'Address parts: {address_parts}')
rejoined = ' | '.join(address_parts)
print(f'Rejoined: {rejoined}')
employee_code = 'EMP-2024-SD'
starts_with_emp = employee_code.startswith('EMP')
ends_with_com = clean_email.endswith('.com')
print(f'Code: {employee_code}')
print(f'Starts with EMP: {starts_with_emp}')
print(f'Clean email: {clean_email}')
print(f'Ends with .com: {ends_with_com}')
# User Editable Region
dot_count = 'sarah.davis@company.com'
dash_count = 'EMP-2024-SD'
print(dot_count.count('.'))
print(dash_count.count('-'))
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36
Challenge Information:
Build an Employee Profile Validator - Step 20