Python – Check if key exists in dictionary

In Python, you can use the in operator to check if a key exists in a dictionary.python test.py def main(): fruits = { 'apple':1, 'orange':2, 'banana':3 } #if key '
相關文章
相關標籤/搜索