Create a app for student number planning. Allow user to customise following levels: program, home/international, exchange in and out, school and department, UG/TPG/RPG, goal of next 5 years(which could be editable and customised)
To upload files, please first save the app
import streamlit as st
st.title('Student Number Planning')
# Initialize session state for storing user inputs if not already present
if 'program' not in st.session_state:
st.session_state['program'] = ''
st.session_state['home_international'] = ''
st.session_state['exchange_in'] = 0
st.session_state['exchange_out'] = 0
st.session_state['school'] = ''
st.session_state['department'] = ''
st.session_state['level'] = ''
st.session_state['goal'] = [0] * 5 # list for 5 years goals
# Inputs for customizing the student numbers
st.header('Customize Your Inputs')
st.sidebar.subheader('Program')
st.session_state['program'] = st.sidebar.text_input('Program Name', st.session_state['program'])
st.sidebar.subheader('Home/International')
st.session_state['home_international'] = st.sidebar.selectbox('Home or International', ['Home', 'International'], index=0)
st.sidebar.subheader('Exchange In/Out')
st.session_state['exchange_in'] = st.sidebar.number_input('Exchange In', min_value=0, value=st.session_state['exchange_in'])
st.session_state['exchange_out'] = st.sidebar.number_input('Exchange Out', min_value=0, value=st.session_state['exchange_out'])
st.sidebar.subheader('School and Department')
st.session_state['school'] = st.sidebar.text_input('School Name', st.session_state['school'])
st.session_state['department'] = st.sidebar.text_input('Department Name', st.session_state['department'])
st.sidebar.subheader('Level of Study')
st.session_state['level'] = st.sidebar.selectbox('Select Level', ['UG', 'TPG', 'RPG'], index=0)
st.sidebar.subheader('Goals for Next 5 Years')
for i in range(5):
st.session_state['goal'][i] = st.sidebar.number_input(f'Year {i + 1} Goal', min_value=0, value=st.session_state['goal'][i])
# Display the summary of inputs
st.header('Summary of Your Planning')
st.write('### Program:', st.session_state['program'])
st.write('### Home/International:', st.session_state['home_international'])
st.write('### Exchange In:', st.session_state['exchange_in'])
st.write('### Exchange Out:', st.session_state['exchange_out'])
st.write('### School:', st.session_state['school'])
st.write('### Department:', st.session_state['department'])
st.write('### Level:', st.session_state['level'])
st.write('### Goals for Next 5 Years:', st.session_state['goal'])
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?