hi i want to check if a string from user input has two repeated characters/letters in a string next to eachother.. i have a simple code to check if the first letter and second l
As the comments already mentioned you should use a for loop:
def two_same(string)
for i in range(len(string)-1):
if string[i] == string[i+1]:
return True
return False
result = ""
while not two_same(result):
result = input("enter the same letter twice:")
print(result)