I am trying to match specific router interfaces. However, I am finding the below confusing, when searching for specific interface numbers, it is matching on the first condition, when i think it should be matching on the second condition:
string = ["TenGigE0/0/0/0.12", "TenGigE0/0/0/1.46", "TenGigE0/0/0/15.55"]
for item in string:
if 'TenGigE0/0/0/0' in item or 'TenGigE0/0/0/1' in item:
print("Yes")
elif 'TenGigE0/0/0/15' in item:
print("cool")
Output is:
Yes
Yes
Yes
How can i fix this?