标签:ice while 添加 [] 错误 color class inpu 存在
path = [] while True: temp = db for item in path: temp = temp[item] print("当前所有的子节点:",list(temp.keys())) choice = input("1:添加节点;2:查看节点;(Q/b);\n>>>") if choice == "1": name = input("请输入子节点名称 ") if name in temp: print("节点存在") else: temp[name] = {} elif choice == "2": name = input("请输入要查看的节点名称:\n>>>") path.append(name) elif choice.lower() == "b": if path: path.pop() elif choice.lower() == "q": break else: print("输入错误请重新输入")
标签:ice while 添加 [] 错误 color class inpu 存在
原文地址:https://www.cnblogs.com/liubi/p/8855434.html