May-11-2022, 04:02 PM
how can I check if an element is in a list in a dictionary value? for instance
how can I get this code to output "Found it"
a = "Doors"
dict = {"a":["Doors","Windows"],"b":"Stairs"}
if a in dict.values():
print("Found it")
else:
print("sorry")
Thank you
how can I get this code to output "Found it"
a = "Doors"
dict = {"a":["Doors","Windows"],"b":"Stairs"}
if a in dict.values():
print("Found it")
else:
print("sorry")
Thank you