> For the complete documentation index, see [llms.txt](https://docs.r.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r.xyz/glider-ide/api/variables/localvariables/localvariable/localvariable.index.md).

# LocalVariable.index

Returns the index of the local variable in relation to the function scope.

## Query Example

```python
from glider import *


def query():
  functions = (
    Functions()
    .with_name("communityMint")
    .exec(1)
  )

  for func in functions:
    local_vars = func.local_variables().list()
    for local_var in local_vars:
      print(local_var.source_code())
      print(local_var.index)

  return functions
```

## Example Output

<figure><img src="https://2237101709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDX4Ojc4j1ef51TUAtYOx%2Fuploads%2FH1bwJzEaNI0taSOBdIXi%2FScreenshot%202025-09-10%20at%204.50.47%E2%80%AFPM.png?alt=media&amp;token=7b8d82be-08c9-4309-ad80-9ea2be815b26" alt=""><figcaption></figcaption></figure>
