Q:

I keep getting an error called 'int' object has no attribute 'replace'

For my code I don't need to replace numbers, only things like parenthesis and dashes and I thought I spec ifoed that in my code but it still doesnt work. Here is the code:
def standardize_phone_number(phone_number):
    phone_number = str(phone_number.replace('(', '')\
                         .replace(')', '')\
                         .replace(' ', '')\
                         .replace('-', ''))

    if not (phone_number.isdigit() and len(phone_number) == 10):
        return None

    if phone_number[0] == '(' and phone_number[4:6] == ')' and \
       phone_number[9] == '-' and len(phone_number) == 13:
        return phone_number.replace('(', '').replace(')', '-')

    if phone_number[3] == '-' and phone_number[7] == '-' and \
       len(phone_number) == 11:
        return phone_number.replace('-', '').replace('-', '')

    if phone_number[5] == ' ' and phone_number[9] == '-' and \
       len(phone_number) == 13:
        return phone_number.replace(' ', '').replace('-', '')
    else:
        return None
print(standardize_phone_number(123-456-7890))

A:

The problem is that you're passing an int as input to standardize_phone_number, specifically the int 123-456-7890, which is -8223, while standardize_phone_number expects a string.
What you want instead is:
standardize_phone_number('123-456-7890')

Edit: On Returning None
With the input above, your code will reach the final else and therefore, return None. Since you strip out all occurrences of the characters '(', ')', ' ', and '-', the phone_number string will just be the digits entered (assuming a valid phone number format is entered). So none of your if conditions will ever evaluate to True.
It looks like you are meaning to remove all instances of the characters '(', ')', ' ', and '-' from a phone number and just return the digits of the phone number. In that case you can reduce your code to:
def standardize_phone_number(phone_number):
    phone_number = str(phone_number.replace('(', '')\
                         .replace(')', '')\
                         .replace(' ', '')\
                         .replace('-', ''))

    if phone_number.isdigit() and len(phone_number) == 10:
        return phone_number
    else:
        raise ValueError("The number you entered is not a valid phone number")

With re.sub you can compact all those replace calls into one:
import re

def standardize_phone_number(phone_number):
    phone_number = re.sub(r'[()\s-]', '',  phone_number)
    if phone_number.isdigit() and len(phone_number) == 10:
        return phone_number
    else:
        raise ValueError("The number you entered is not a valid phone number")

Of course, the ValueError is optional, you can implement whatever handling you think is right for invalid phone numbers.

