Перевести с паскаля на python: var k, s: string; n: integer; begin read(s); n : = 100; while n > 0 do begin n : = pos('/', s); if n > 0 then begin k : = copy(s, 1, n - 1); writeln(k); delete(s, 1, n); end else n : = 0; end; k : = copy(s, n, length(s)); writeln(k); end.
while s.find("/")>0:
print(s[0:s.find("/")])
s = s[s.find("/")+1:len(s)]
print(s)
Пример:
s:
123/abcde/78/xyz
123
abcde
78
xyz