Answer:
Check the explanation
Step-by-step explanation:
def has_triggers(string):
### split() splits the string using comma and store them in a list li
li=string.split(",")
### iterate through the list and find the size of 5
for i in range(len(li)):
## # if the length is > 0 and the all the 5 characters are same then returns true.
if(len(li[i])>0 and li[i]==li[i][0]*5):
return True
return False
###calling function by passing the input string and prints the returned value
print(has_triggers('a,aaaa,aaaaa,a'))
print(has_triggers('ab,xxxxx,yxyx,m'))
print(has_triggers('ab,xx,xx,yxyx,n'))
print(has_triggers('ab,pppppppppp,qq'))
print(has_triggers(',abc,abc,abc,,,'))