davegimo

spli

Oct 20th, 2023
937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. def split_(s,separatore):
  2.     l = []
  3.     pivot = 0
  4.     len_sep = len(separatore)
  5.    
  6.     for i in range(len(s)):
  7.         print(s[i:len_sep + i])
  8.         if s[i:len_sep + i] == separatore:
  9.             l.append(s[pivot:i])
  10.             pivot = i + len_sep
  11.            
  12.     l.append(s[pivot:])
  13.     return l
Advertisement
Add Comment
Please, Sign In to add comment