def strip_slashes(name):
 if name.startswith('/'):
  name = name[1:]
 if name.endswith('/'):
  name = name[:(-1)]
 return name

def strip_slashes ( name ) : if name . startswith ( '/' ) : name = name [ 1 : ] if name . endswith ( '/' ) : name = name [ : ( - 1 ) ] return name
remove slashes from the beginning and end of a part/url .