@nogood/Anagram Tester with Functional-Style Quicksort

No description

def quickSort (word):
    if len(word) > 0:
        #defines the pivot value as k
        k = word[0]
        #makes a list of all values in the list after k less than k
        lower = list(filter(lambda x: x < k, word[1:]))
        #same as above, but > or = to k
        higher = list(filter(lambda x: x >= k, word[1:])) 
        #put k between the list of value less than and greater than k, then sort those lists
        return quickSort(lower) + [k] + quickSort(higher)
        return [] #an empty list is already sorted

def isAnagramOf (word1, word2):
    #takes away spaces, makes upper case
    word1 = word1.replace(" ","").upper()
    word2 = word2.replace(" ","").upper()
    #words cannot be anagrams if they have a different # of letters
    if len(word1) != len(word2):
        return 0
    #sort each word, if they are the same sorted, they are anagrams
    if quickSort(word1) == quickSort(word2):
        return 1
        return 0
Python 3.6.1 (default, Dec 2015, 13:05:11) [GCC 4.8.2] on linux