Project
This commit is contained in:
8
24.5.py
8
24.5.py
@@ -1,14 +1,12 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
str1=open('24_5.txt').read().strip('\n')
|
str1=open('24_5.txt').read()
|
||||||
# result=re.split(r'(?<=PP)',str1) #Позитивная ретроспективная проверка (Positive Lookbehind)
|
# result=re.split(r'(?=PP)',str1) #Позитивная ретроспективная проверка (Positive Lookbehind)
|
||||||
result=re.split(r'(?=PP)',str1) #позитивная опережающая проверка (positive lookahead)
|
result=re.split(r'(?=PP)',str1) #позитивная опережающая проверка (positive lookahead)
|
||||||
# result=re.split(r'P(?=P)',str1)
|
# result=re.split(r'P(?=P)',str1)
|
||||||
print(max(list(map(len,result))))
|
print(max(list(map(len,result))))
|
||||||
|
|
||||||
|
|
||||||
# f=open('24_5.txt')
|
# f=open('24_5.txt')
|
||||||
# s=f.read().rstrip()
|
# s=f.read()
|
||||||
# k=1
|
# k=1
|
||||||
# kmax=0
|
# kmax=0
|
||||||
#
|
#
|
||||||
|
|||||||
2
24.6.py
2
24.6.py
@@ -1,5 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
str1=open('24_6.txt').read().strip()
|
str1=open('24_6.txt').read().strip()
|
||||||
result=re.split(r'000+',str1)
|
result=re.split(r'(?=00)0',str1) #Негативный просмотр вперед (Negative Lookahead)
|
||||||
print(max(list(map(len,result))))
|
print(max(list(map(len,result))))
|
||||||
Reference in New Issue
Block a user