Splitting a path into 2 parts Example: Input: https:algorithmsunixtest.py   for url Output: part0: https:algorithmsunix part1: test.py Input: algorithmsunixtest.py          for file path Output: part0: algorithmsunix part1: test.py Takt the origin path without the last part Take the last element of list
import os

def split(path):
    parts = []
    split_part = path.rpartition('/')
    # Takt the origin path without the last part
    parts.append(split_part[0])
    # Take the last element of list
    parts.append(split_part[2])
    return parts
