Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- factory_struct = {
- "pipe": [],
- "input": [],
- "pump": [],
- "tank": [5, 6, 7, 8],
- "pipe_c": [],
- "tank_g": [9, 10, 11, 12],
- "stock": [13, 14]
- }
- L = [(1, 5), (2, 6), (3, 7), (4, 8), (5, 9), (5, 10), (6, 10), (6, 11), (7, 9), (7, 11), (8, 12), (9, 13), (10, 13), (11, 14), (12, 14)]
- D = []
- for i in range(len(L)):
- if L[i][0] in factory_struct["tank"] or L[i][0] in factory_struct["tank_g"] or L[i][0] in factory_struct["stock"]:
- for j in range(i, len(L)):
- if L[i][1] == L[j][0]:
- D.append((i, j))
- for item in D:
- print(item)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement