2024-05-12 20:00:52 发布
网友
在test.py中
def module1(): .... .... .... print dic1 module1() def module2(): .... .... .... print dic2 module2()
我想在test.py中有一个名为module3()的函数,它将以最简单的方式比较这两个字典,如果它们匹配,则显示结果'matched';如果它们不匹配,则显示结果'not matched'。有什么帮助吗
test.py
module3()
'matched'
'not matched'
为什么不把字典还给我
def module1(): ... ... ... return dic1 def module2(): ... ... ... return dic2: def module3(): d1 = module1() d2 = module2() if d1 == d2: print 'matched' else: print 'not matched'
为什么不把字典还给我
相关问题 更多 >
编程相关推荐