Both URL and file path joins use slashes as dividers between their parts. For example: pathtodir  file  pathtodirfile pathtodir  file  pathtodirfile http:algorithms.com  part  http:algorithms.compart http:algorithms.com  part  http:algorithmspart Remove  trailing Remove  leading
import os

def join_with_slash(base, suffix):
    # Remove / trailing
    base = base.rstrip('/')
    # Remove / leading
    suffix = suffix.lstrip('/').rstrip()
    full_path = "{}/{}".format(base, suffix)
    return full_path
