> 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/statevariables/statevariable/statevariable.source_code.md).

# StateVariable.source\_code()

Returns the source code of the state variable.

`source_code() → str`

## Query Example

```python
from glider import *


def query():
  state_variables = (
    StateVariables()
    .exec(5)
  )

  for state_var in state_variables:
    print(state_var.source_code())

  return state_variables
```

## Example Output

<figure><img src="https://2237101709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDX4Ojc4j1ef51TUAtYOx%2Fuploads%2Fv1hrX1LpeCZWGxbnsL1R%2Fimage.png?alt=media&amp;token=d5e6e024-65ae-4a42-bc48-647851252a1a" alt=""><figcaption></figcaption></figure>
