我有一本字典作为
local={'obj1' : p }
其中 p 是其他一些具有结构的类名的对象
class name:
x = 0
y = 0
time = 0
PCH = []
FCC_Queue = []
我已经使用 name 类的对象存储了值,现在我想检查 PCH 和 FCC_Queue 中存在的值。假设我想检查 10 是否存在于 PCH 列表中,我应该写什么作为 if 语句的条件?
最佳答案
i wanted to check 10 is present inside PCH list
if 10 in local["obj1"].PCH:
# do stuff
关于python - 如何访问字典中的列表值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36892138/