You are viewing a single comment's thread. Return to all comments →
def alternatingCharacters(s): # Write your code here i=0 count = 0 s = list(s) while i < len(s) - 1: if s[i] == s[i+1]: count+=1 s.remove(s[i+1]) continue i+=1 return count
Seems like cookies are disabled on this browser, please enable them to open this website
Alternating Characters
You are viewing a single comment's thread. Return to all comments →