So I am trying to accept user input from a text box then add the input to a list, the text box should subsequently accept more inputs and keep adding to the list and displays the list at every new item added
But each time I add a new input, it overwrites the previous one
Here is my code snippet
import streamlit as st
def main():
# Creating a list of reviews (serves as the database in this use case)
list_of_reviews = []
# Disply structure
st.title('TEXT SENTIMENT ANALYZER')
col = st.columns(2)
# input section
with col[0].form(key='input form'):
user_input = st.text_input('Review product')
button = st.form_submit_button(label='Submit')
if button:
list_of_reviews.append(user_input)
st.write(f'Review Count: {len(list_of_reviews)}')
#reviews section
st.subheader('REVIEWS')
for i in list_of_reviews:
st.write('*',i)
how do I fix it