I'm just getting back into python, and I'm trying to search over two characters at a time through a string, and replace them with something else. Such as searching through the string "aah" for the string "aa" and replacing it with something else, such as "xx" but when I try to run it, it says type must be a string, not int. This is my code, any help would be greatly appreciated, thanks
test = input("enter words to encrypt\n")
#print(test)
#change a letter
def changea(test):
#print(test)
outp = ""
for i in test:
if i & i+1 == "aa":
outp += "x"
else:
outp += i
print(outp)
changea(test)