How can a Python3 dictionary key be called without hardcoding references in the code like ie. if/else statements (with entry/input)?

前端 未结 0 1472
深忆病人
深忆病人 2020-12-06 15:25

\'\'\' d = { \'key1\': \'value1\', \'key2\': \'12345\', \'anotherKey\': \'anotherValue\',

}

for x in d.items(): ans = input("Enter dict key") if ans

相关标签:
回答
  • 消灭零回复
提交回复
热议问题