Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Check if a Key is Already Present in a Dictionary

my_dict = {1: 'a', 2: 'b', 3: 'c'}

if 2 in my_dict:
    print("present")
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #Check #Key #Already #Present #Dictionary
ADD COMMENT
Topic
Name
6+8 =