Let's call our script counter.py. It initializes a count variable and has a button to increment the value stored in the count variable:
```python
import streamlit as st
st.title('Counter Example')
count = 0
increment = st.button('Increment')
if increment:
    count += 1
st.write('Count = ', count)
```
No matter how many times we press the Increment button in the above app, the count remains at 1. Let's understand why:
Each time we press the Increment button, Streamlit reruns counter.py from top to bottom, and with every run, count gets initialized to 0 .
Pressing Increment subsequently adds 1 to 0, thus count=1 no matter how many times we press Increment.
As we'll see later, we can avoid this issue by storing count as a Session State variable. By doing so, we're indicating to Streamlit that it should maintain the value stored inside a Session State variable across app reruns.
