# Var

## <mark style="color:purple;">`var`</mark>(*name*: *str*, *default*: *decimal*, *cache\_by*: *tuple*=())

Function that is used for holding dynamic variables. Returns object that supports:

<mark style="color:red;">`get() -> decimal`</mark>

returns value of variable or default if unset

<mark style="color:red;">`set(value: decimal, ttl: decimal=inf) -> decimal`</mark>

set value to `value` , returns value

<mark style="color:red;">`ttl`</mark> - optional ttl of variable, default to inf

Examples:

<mark style="color:red;">`get`</mark> returns 5 if variable unset

Set variable’s value to 10

Example:
