yashm commited on
Commit
ec75e94
·
verified ·
1 Parent(s): 81f448f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,9 +1,9 @@
1
  import streamlit as st
2
 
3
-
4
  # Streamlit app
5
  st.title("Biology English Grammar Helper")
6
- st.write("This tool helps biology students learn English grammar tenses with relevant examples.")
 
7
 
8
  # Tenses and explanations
9
  tenses = {
@@ -187,10 +187,11 @@ tenses = {
187
  },
188
  }
189
 
190
- # Select a tense
191
- tense_selected = st.selectbox("Choose a tense to learn:", list(tenses.keys()))
 
 
192
 
193
- # Display selected tense information
194
  if tense_selected:
195
  st.subheader(f"{tense_selected} Tense")
196
  tense_info = tenses[tense_selected]
@@ -198,4 +199,4 @@ if tense_selected:
198
  st.write(f"**Use:** {tense_info['use']}")
199
  st.markdown("**Examples:**")
200
  for example, explanation in tense_info['examples']:
201
- st.write(f"- **{example}**: {explanation}")
 
1
  import streamlit as st
2
 
 
3
  # Streamlit app
4
  st.title("Biology English Grammar Helper")
5
+ st.sidebar.write("Select a tense to learn:")
6
+
7
 
8
  # Tenses and explanations
9
  tenses = {
 
187
  },
188
  }
189
 
190
+ tense_selected = None
191
+ for tense_name in tenses.keys():
192
+ if st.sidebar.button(tense_name):
193
+ tense_selected = tense_name
194
 
 
195
  if tense_selected:
196
  st.subheader(f"{tense_selected} Tense")
197
  tense_info = tenses[tense_selected]
 
199
  st.write(f"**Use:** {tense_info['use']}")
200
  st.markdown("**Examples:**")
201
  for example, explanation in tense_info['examples']:
202
+ st.write(f"- **{example}**: {explanation}")