Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def two_lengt_run(list):
- i = 0
- p = []
- g = 0
- a = False
- length = len(list)
- while i in range(0,length):
- if int(list[i]) == int(list[i+1]):
- a = True
- g = g + 1
- elif int(list[i]) != int(list[i+1]):
- a = False
- if a == False:
- p.append(g + 1)
- g = 0
- if i != length:
- break
- i = i + 1
- print(max(p))
- list = input('Enter a list of characters separated ').strip().split(" ")
- two_lengt_run(list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement