Traceback (most recent call last):
File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/state/session_state.py", line 371, in __getitem__
return self._getitem(widget_id, key)
File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/state/session_state.py", line 411, in _getitem
raise KeyError
KeyError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/script_runner.py", line 354, in _run_script
exec(code, module.__dict__)
File "/app/master_thesis/streamlit_app.py", line 139, in <module>
if st.session_state['answer'] in realans:
File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/state/session_state.py", line 667, in __getitem__
return state[key]
File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/state/session_state.py", line 373, in __getitem__
raise KeyError(_missing_key_error_message(key))
KeyError: 'st.session_state has no key "answer". Did you forget to initialize it?'
[client] Connecting...
st.session_state['answer'] = ''
if st.session_state['answer'] in realans:
answerStat = "correct"
elif st.session_state['answer'] not in realans:
answerStat = "incorrect"