Skip to content
Code ReadingAny Repeat?
Break the Code

Any Repeat?

Write a list for which this function gives the wrong answer.
1def has_repeat(values):
2 for i in range(len(values) - 1):
3 if values[i] == values[i + 1]:
4 return True
5 return False