-3

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
flawy
  • 57
  • 8
  • Please can can you expand on on your question, I don't understand what you are looking for – Rlz Aug 25 '17 at 22:25
  • 1
    You are looking for [dictionaries](https://docs.python.org/3/tutorial/datastructures.html#dictionaries). More [docs here](https://docs.python.org/3/library/stdtypes.html#mapping-types-dict) – juanpa.arrivillaga Aug 25 '17 at 22:25

1 Answers1

2
a = {}
a["x"] = 10
a["y"] = 10
print(a["x"])
print(a["y"])

# OUTPUT
10
10

Is this what you are talking about?

Hello World
  • 168
  • 6