Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tabela_1 = (
- (1, "Jakies dane", "testest"),
- (2, "Jakies dane 2", "testest"),
- (3, "Jakies dane 3", "testest"),
- (4, "Jakies dane 4", "testest")
- )
- tabela_laczaca = (
- (1, 2, 3),
- (2, 2, 2),
- (3, 3, 1),
- (4, 1, 1)
- )
- tabela_2 = (
- (1, "Nowe dane", "testest"),
- (2, "Nowe dane 2", "dasdas"),
- (3, "Nowe dane 3", "teasdasdstest"),
- (4, "Nowe dane 4", "dasd")
- )
- for row in tabela_1:
- id = row[0]
- opisy = []
- for elem in tabela_laczaca:
- tabela_1_id = elem[1]
- tabela_2_id = elem[2]
- if id == tabela_1_id:
- for wiersz in tabela_2:
- id_2 = wiersz[0]
- if tabela_2_id == id_2:
- opisy.append(wiersz[1])
- print(row[1] + ", ", "; ".join(opisy))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement