Переведите с паскаля на python var k, max, countA: integer;
c: char;
f: text;
begin
assign(f,'C:\24.txt');
reset(f);
k := 0;
max := 0;
countA := 0;
while not Eof(f) do begin
read(f, c);
if (c = 'E') then begin
if countA > 2 then begin
if k > max then max := k;
end;
k := 0;
countA := 0;
end
else begin
if c = 'A' then countA := countA + 1;
k := k + 1;
end;
end;
if k > max then
max := k;
writeln(max);
end.