Answer:
def hasadjacentrepeat(inarray):
# Initialize a variable to 0 to indicate that there are no adjacent repeated numbers
adjacentrepeat = 0
# Loop through the input array, except for the last element
for i in range(len(inarray)-1):
# Check if the current element is equal to the next element
if inarray[i] == inarray[i+1]:
# If they are equal, set the adjacentrepeat variable to 1 and break out of the loop
adjacentrepeat = 1
break
# Return the value of the adjacentrepeat variable, which is 1 if there are adjacent repeated numbers, 0 otherwise
return adjacentrepeat
Example:
a = [1, 2, 3, 4, 5, 5, 6]
b = [1, 2, 3, 4, 5, 6, 7]
print(hasadjacentrepeat(a)) # Output: 1
print(hasadjacentrepeat(b)) # Output: 0