def add_trailing_slash(path):
 if ((len(path) > 0) and (path[(-1)] == os.sep)):
  return path
 else:
  return (path + os.sep)

def add_trailing_slash ( path ) : if ( ( len ( path ) > 0 ) and ( path [ ( - 1 ) ] == os . sep ) ) : return path else : return ( path + os . sep )
if path does not end with / .