Hello, What does it mean when a variable is defined and in the next line the scripter says variable[something]? Thanks! I know it sounds basic, but I've seen it very often and believe it must be important.
COMMUNITY QUESTION
What does it mean when there is variable[something]?
1 answer
Whenever you use brackets, you're grabbing something from a table.
In example
lottery = ['15','22','35','47','52']
print(lottery[2])
--If this example is correct, it will print out the second thing listed in the table, so in the case, it'll print the number 22.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
It means variable is a table.
Brackets index a table, so if you have t={'a','b','c','d','e'}, t[3] is 'c'