Search code examples
pythonlualua-table

Lua's Table Equivalent In Python


Is there a python table equivalent to lua's?

-- Lua's Table
a = {}
a.x = 10
a.y = 10
print(a.x)
print(a.y)

-- OUTPUT
10
10

Solution

  • a = {}
    a["x"] = 10
    a["y"] = 10
    print(a["x"])
    print(a["y"])
    
    # OUTPUT
    10
    10
    

    Is this what you are talking about?