Python Dictionary – has_key() method

It is a method in python that returns True if the key is present in the dictionary, else returns False. Syntax:dictionary.has_key(key) Also Read: Python Dictionary – fromkeys() method Example 1: Output: Explanation:Here it returned True since the key (1) is present in the dictionary. Example 2: Output: Explanation:Here it returned False since the key (origin) […]

Python Dictionary – has_key() method Read More »