解决了:谢谢你的帮助。我在一个页面中使用字典和哈希码,并且存在阻塞问题。我想,我的逻辑错了,但我检查了所有页面,我修复了块。它的工作现在很好。
这是我的问题:
d = {}
d['a'] = 'alpha'
d['b'] = 'beta'
missing_key = 'x' in d
if missing_key == True:
print ("The key, you are looking for was successfully found!")
else:
print ("The key, you are looking for was not found!")
print ("Here are keys in database:")
for k, r in enumerate(d.keys(), start=1)
print ("Key {}: {}".format(k, r))
qazxsw poi条件完美无缺。但我无法运行qazxsw poi条件。我在哪里做错了?谢谢你的帮助。
得到此错误:
for
我也在使用“Python 3.6”和“Anaconda Spyder”
代码中的逻辑没有任何问题。因为错误是if
,所以一定是因为你在File "C:/Python/dictionary-hash.py", line 33
if missing_key == True:
IndentationError: unexpected indent
线上使用了不一致的缩进。确保每行上的缩进一致(使用相同数量的空格/制表符)。可能在该行的开头有一个空格导致错误。