Files
pythonProject/24.7.py
Victor Alexandrovich Tsyrenschikov 9b1daa8fe5 project
2025-11-21 15:40:29 +05:00

32 lines
760 B
Python

# import re
#
# with open('24_7.txt', 'r') as file:
# data = file.readline()
#
# data = re.sub('CD', '--', data)
#
# not_CD = r'(-?[^-]*)'
#
# CD_and_any = r'(?:--[^-]*){160}-?'
# la_CD_group = rf'(?=({CD_and_any}))'
#
# pattern = rf'{not_CD}{la_CD_group}'
#
# matches = re.findall(pattern, data)
#
# res = max([len(match[0] + match[1])
# for match in matches])
# f = open('24_7.txt').read().strip()
# a = []
# for i in range(len(f) - 1):
# if f[i]+f[i+1] == 'CD':
# a.append(i)
# print(max([p1-p for p,p1 in zip(a, a[161:])]))
lst1 = [0, 1, 2, 3, 4, 5, 7, 8, 9, 10]
# lst2 = [5, 3, 2, 0, 4, 1]
# lst3 = ['нуль', 'один', 'два', 'три', 'четыре', 'пять']
for a, b in zip(lst1,lst1[8:]):
print(f'{a} {b}')