Oct-04-2019, 09:09 PM
Hey Py community,
Im very new to Python so I trying to learn by giving myself small projects at work. Here is a basic version of what I'm
trying to do. The output I'm looking for is:
code:
If someone can point me in the right direction I would greatly appreciate it.
Danny
Im very new to Python so I trying to learn by giving myself small projects at work. Here is a basic version of what I'm
trying to do. The output I'm looking for is:
Output:Gi0/1
Gi0/3
Gi0/4
Gi0/5
Gi0/6
Gi0/7
Gi0/9
But the code and the output I getting is this.code:
a = ("Gi0/1", "Gi0/2", "Gi0/3", "Gi0/4", "Gi0/5", "Gi0/6", "Gi0/7", "Gi0/8", "Gi0/9", "Gi0/10") b = ("Gi0/2", "Gi0/8", "Gi0/10") for num_a in a: for num_b in b: if num_a == num_b: print(num_a)Output:
Output:Gi0/2
Gi0/8
Gi0/10
I also tried if not num_a == num_b:If someone can point me in the right direction I would greatly appreciate it.
Danny