@@ -0,0 +1,1269 @@
+#!/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'', '', True%5D,%0A        %5B'foobarbaz', 'barbazfoo', True%5D,%0A        %5B'foobrabaz', 'barbazfoo', False%5D%0A    %5D%0A%0A    for item in tests:%0A        temp_result = is_rotation(item%5B0%5D, item%5B1%5D)%0A        if temp_result == item%5B2%5D:%0A            print('PASSED: is_rotation(%7B%7D, %7B%7D) returned %7B%7D'.format(item%5B0%5D, item%5B1%5D, temp_result))%0A        else:%0A            print('FAILED: is_rotation(%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_substring(s1, s2):%0A    ''' Determines if s1 is a substring of s2, returns a Boolean '''%0A    if s1 is None or s2 is None:%0A        return False%0A%0A    # Substrings can't be longer than the string%0A    if len(s1) %3E len(s2):%0A        return False%0A%0A    return s1 in s2%0A%0A%0Adef is_rotation(s1, s2):%0A    ''' Determines if a string s1 is a rotation of another string s2, by calling (only once) a function is_substring. Returns a Boolean '''%0A    if s1 is None or s2 is None:%0A        return False%0A%0A    if len(s1) == len(s2) and is_substring(s1, s2 + s2):%0A        return True%0A    else:%0A        return False%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add string rotation problem and tests