If the position and order of the characters are important, then the chosen answer would suffice. The problem is, the given solution will not work if that is not the case.
If position is not important, but the order is, you could write a function that returns the length of the longest common subsequence. Here is a sample implementation:
def lcs(string1, string2):
    m = len(string1)
    n = len(string2)
    C = [[0] * (n + 1)] * (m + 1)
    for i in range(m + 1)[1:]:
        for j in range(n + 1)[1:]:
            if string1[i - 1] == string2[j - 1]:
                C[i][j] = C[i - 1][j - 1] + 1
            else:
                C[i][j] = max(C[i][j - 1], C[i - 1][j])
    return C[m][n]
If position and order does not matter, you can use collections.Counter (Python 2.7/3.1; or http://code.activestate.com/recipes/576611/) like so:
def f(string1, string2):
    set_string1 = Counter(string1)
    set_string2 = Counter(string2)
    # get common characters
    common = set_string1 & set_string2
    # return the sum of the number of occurrences for each character
    return reduce(lambda a, b: a + b, common.values())