Question: 
Write a python function to check whether the given string is made up of two alternating characters or not.


Model's Code:
def is_Two_Alter(s):
    return len(set(s)) == 2 and all(s[i] != s[i + 1] for i in range(len(s) - 1))



Sample Correct Code:
def is_Two_Alter(s):  
    for i in range (len( s) - 2) : 
        if (s[i] != s[i + 2]) : 
            return False
    if (s[0] == s[1]): 
        return False
    return True


Asserts:
assert is_Two_Alter("abab") == True
assert is_Two_Alter("aaaa") == False
assert is_Two_Alter("xyz") == False


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 914 of 974: 704/914 (77.02407002188184%): success