You are viewing a single comment's thread. Return to all comments →
def alternatingCharacters(s): # Write your code here list1=[] for i in range(0,len(s)-1): if s[i] == s[i+1]: list1.append(s[i])
#print (list1) return len(list1)
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 →
def alternatingCharacters(s): # Write your code here list1=[] for i in range(0,len(s)-1): if s[i] == s[i+1]: list1.append(s[i])