#String, String -> String def removeMatches(myString, removeString): """This method removes the letter from myString that are also letters in removeString""" newStr = "" for ch in myString: if ch not in removeString: newStr = newStr + ch return newStr #String -> String def removeDupes(myString): """This function removes the duplicate characters from a string""" newStr = "" for ch in myString: if ch not in newStr: newStr = newStr + ch return newStr #String -> String def genKeyFromPass(password): """This function generates a key from user's password""" key = "abcdefghijklmnopqrstuvwxyz" password = removeDupes(password) lastChar = password[-1] lastIdx = key.find(lastChar) afterString = removeMatches(key[lastIdx+1:], password) beforeString = removeMatches(key[:lastIdx],password) key = password + afterString + beforeString return key