of coursein pythononce againwe can take advantage of duck typing to implicitly provide the interfaceso we only need to write two classes let' define these interfaces firstclass folderdef __init__(selfname)self name name self children {def add_child(selfchild)pass def move(selfnew_path)pass def copy(selfnew_path)pass def delete(self)pass class filedef __init__(selfnamecontents)self name name self contents contents def move(selfnew_path)pass def copy(selfnew_path)pass def delete(self)pass for each folder (compositeobjectwe maintain dictionary of children oftena list is sufficientbut in this casea dictionary will be useful for looking up children by name our paths will be specified as node names separated by the charactersimilar to paths in unix shell