> For the complete documentation index, see [llms.txt](https://solstep.gitbook.io/solidity-steps/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://solstep.gitbook.io/solidity-steps/step-1/9-pure-keyword.md).

# 9: Pure Keyword

Solidity provides a special keyword, pure, that can be used to indicate that a function does not alter the state of any of the variables in the contract. This is useful for functions that only return a value based on the inputs, without changing anything else.

A pure function does not:

* Read or write to the blockchain
* Create or send a transaction
* Access any state variables
* Call any other functions

Using the pure keyword provides a guarantee to the compiler that the function won’t alter the state of the contract, which can be used to optimize the code. It also allows the function to be called in constant time, meaning it won’t be affected by the size of the blockchain or the number of transactions.

Example of a *pure function* in Solidity:

```solidity
function add(uint a, uint b) public pure returns (uint) {  
    return a + b;
}
```

*That's it for the lesson 9! In the next lesson, Constant Keyword*
