Is there some function I can use that lets me check the value of something from an array from just its index number?

For example, say I have an array with the values ["red", "orange", "green", "purple"]
Is there a function that would take an input of 3 and return "green" from the array?

  • Never mind; found the answer myself. To do this, just type the name of the array then the index number you want to call from in brackets.

    So if the previous example array was called "colors," you wanted to print "green," you would type
    print(colors[3])

Never mind; found the answer myself. To do this, just type the name of the array then the index number you want to call from in brackets.

So if the previous example array was called "colors," you wanted to print "green," you would type
print(colors[3])