# replace with your 2d table 👇
lookup_table = [
[10, 20, 30],
[40, 50, 60],
[70, 80, 90]
]
(transpose) the table
def invert_table(table):
return [list(row) for row in zip(*table)]
inverted_table = invert_table(lookup_table)
print("Original Table:")
for row in lookup_table:
print(row)
print("\n")
print("Inverted Table:")
for row in inverted_table:
print(row)
# replace with your 2d table 👇
lookup_table = [
[10, 20, 30],
[40, 50, 60],
[70, 80, 90]
]
(transpose) the table
def invert_table(table):
return [list(row) for row in zip(*table)]
inverted_table = invert_table(lookup_table)
print("Original Table:")
for row in lookup_table:
print(row)
print("\n")
print("Inverted Table:")
for row in inverted_table:
print(row)