1 2 3 4 >>> type(os.sep) <class 'str'> >>> os.sep.join(["foobar", "/foo/baz/", "whatever"]) 'foobar//foo/baz//whatever'