selebry

8

May 14th, 2023
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. from re import split
  2.  
  3.  
  4. def main(s):
  5. split_list = list(filter(None, split(
  6. ' |begin|variable|[.]?end|;|:=|[.]do|,|\n', s)))
  7. res = [(split_list[i], split_list[i + 1]) for i in range(
  8. 0, len(split_list), 2)]
  9. return res
  10. print(main('.do begin variable edorxe:= xeinat; end,begin variable raesla :=\norce_312; end, .end'))
Add Comment
Please, Sign In to add comment