I want to search for a part of a string only from the values
(not keys
) from a dictionary in Python.
But the code I have is not able to search for the part of string which I got from a device output.
Here is the code
n = {'show run | i mpls ldp': '\rMon Jun 26 06:21:29.965 UTC\r\nBuilding configuration...\r\nmpls ldp'}
if "mpls ldp" in n:
print("yes")
else:
print("no")
Everytime when I run it always prints no
.
I want to search for mpls ldp
in the \nBuilding configuration...\r\nmpls ldp
value part.