Skip to content

Commit a4b3a29

Browse files
committed
Update Display interactive widgets.md
1 parent e13c547 commit a4b3a29

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Diff for: Display interactive widgets.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,21 @@ Displays a download button labeled "On the dl" to download the provided data in
6060
Allows capturing images from the camera with the specified label in the Streamlit app.
6161

6262
st.color_picker('Pick a color')
63-
Displays a color picker in the Streamlit app.
63+
Displays a color picker in the Streamlit app.
64+
65+
Here's a description of each line of code:
66+
67+
for i in range(int(st.number_input('Num:'))): foo()
68+
69+
This line creates a loop based on the number entered by the user in a number input widget. For each iteration of the loop, the function `foo()` is called.
70+
71+
if st.sidebar.selectbox('I:',['f']) == 'f': b()
72+
73+
This line displays a select box widget in the sidebar with the options ['f']. If the user selects 'f', the function `b()` is called.
74+
75+
my_slider_val = st.slider('Quinn Mallory', 1, 88)
76+
This line displays a slider widget labeled 'Quinn Mallory' with values ranging from 1 to 88. The value selected by the user is stored in the variable `my_slider_val`.
77+
78+
st.write(slider_val)
79+
80+
This line attempts to display the value of the variable `slider_val`, but it seems to be a typo as the variable is defined as `my_slider_val`. It should be `st.write(my_slider_val)` to correctly display the value of the slider.

0 commit comments

Comments
 (0)