find the longest consecutive numbers in a string python
def consecutive_numbers(string, num):
count = 0
pointer = 0
max_consecutive = 0
while count < len(string):
if string[count] == str(num):
pointer += 1
if pointer > max_consecutive:
max_consecutive = pointer
else:
pointer = 0
count += 1
return max_consecutive
if __name__ == '__main__':
string = input()
number = input()
print(consecutive_numbers(string, number))