Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Открываем файл
- #f=open('C:/Users/DaniDori/Downloads/24.txt', 'r')
- f="xxyxy"
- maxlen=0
- lastChar=0
- count=0
- for i in f:
- if i!=lastChar:
- count+=1
- print(count)
- else:
- if count>maxlen:
- maxlen=count
- count=1
- lastChar=i
- if count>maxlen:
- maxlen=count
- print(maxlen)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement