My Input does not update

I wanted to build a “Cookie clicker” sort of app to learn to use the Streamlit button widget. Basically I want to add 1 to a variable everytime I press the button and the value should change accordingly. However, it does not work in my case.Screenshot 2020-05-13 at 4.40.05 PM

This is because you are referencing a global variable.
Updating your code as below should work!! :beers:
image

2 Likes