@@ -0,0 +1,1535 @@
+#!/Applications/anaconda/envs/Python3/bin%0A%0A%0Adef main():%0A    # Test suite%0A    tests = %5B%0A        %5BNone, 'foo', False%5D,%0A        %5B'', 'foo', False%5D,%0A        %5B'Nib', 'bin', False%5D,%0A        %5B'act', 'cat', True%5D,%0A        %5B'a ct', 'ca t', True%5D%0A    %5D%0A%0A    for item in tests:%0A        temp_result = is_permutation(item%5B0%5D, item%5B1%5D)%0A        if temp_result == item%5B2%5D:%0A            print('PASSED: is_permutation(%7B%7D, %7B%7D) returned %7B%7D'.format(item%5B0%5D, item%5B1%5D, temp_result))%0A        else:%0A            print('FAILED: is_permutation(%7B%7D, %7B%7D) returned %7B%7D, should have returned %7B%7D'.format(item%5B0%5D, item%5B1%5D, temp_result, item%5B2%5D))%0A%0A    return 0%0A%0A%0Adef is_permutation(str1, str2):%0A    '''%0A    Determines if string is a permutation of another%0A    Input: two strings%0A    Output: Boolean%0A    Assumes case and white space matter. Empty strings return False%0A    '''%0A    # Check input%0A    if str1 is None or str2 is None:%0A        return False%0A%0A    if not str1 or not str2:%0A        return False%0A%0A    # Check lengths%0A    if len(str1) != len(str2):%0A        return False%0A%0A    char_dict = %7B%7D%0A%0A    # Build character frequency dictionary for first string%0A    for c in str1:%0A        try:%0A            char_dict%5Bc%5D += 1%0A        except KeyError:%0A            char_dict%5Bc%5D = 1%0A%0A    # Check characters in second string against character dictionary%0A    for c in str2:%0A        try:%0A            char_dict%5Bc%5D -= 1%0A            if char_dict%5Bc%5D %3C 0:%0A                return False%0A        except KeyError:%0A            return False%0A%0A    return True%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add isPerm problem and tests