with open('1.txt', 'r') as f:
raw_lines = f.readlines()
print(raw_lines)
for line in raw_lines:
count_a, count_result = 0, 0
if line.count('A') < 25:
for symbol in line:
if symbol == 'A':
count_a += 1
else:
if count_result < count_a:
count_result = count_a
count_a = 0
if count_result == 0 and count_a > 0:
count_result = count_a
print(f'Max distance between A in line -- {count_result}')
def flatten(x):
if isinstance(x, list):
for q in x:
yield from flatten(q)
else:
yield x
>>> list(flatten([1,2,3, [1,2, [3, [[[[4]]]]]]]))
[1, 2, 3, 1, 2, 3, 4]
print("654321")
s = "Proxy(host='47.251.13.204', port='3128', code='us', country='united states', anonymous=False, type='http', source='us-proxy')"
host = re.search(r"host='(.+?)'", s).group(1)
port = re.search(r"port='(.+?)'", s).group(1)
print(host, port)
SELECT
COUNT(table.id) AS num_id
FROM table
в num_id
будет твой ответ.