You could maybe have other solutions to check the given key exists in the dictionary or not, like,
if key in dicObj.keys()
It could give you the same result as the solution we just showed you. But this
dicObj.keys() method is roughly four times slower because it takes extra time to convert the dictionary keys to a list.
You could refer to the execution time performance comparison test below.