Update slider value

I might be just misunderstanding how streamlit works but to further explain my question…

if st.button(‘addition’):
x+=1

If I hit the button 5 times x will always be 1 if it started by 0.

Is the ability to have x = 5 at the end of 5 button presses something handled by SessionState?

For now I will just output this value to a file and read that value then update that value, etc. However, that’s not a very elegant solution.