Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# Define the greet function
|
| 4 |
+
def greet(name, intensity):
|
| 5 |
+
return "Hello, " + name + "!" * int(intensity)
|
| 6 |
+
|
| 7 |
+
# Streamlit UI
|
| 8 |
+
st.title("Greeting App 👋")
|
| 9 |
+
|
| 10 |
+
name = st.text_input("Enter your name:")
|
| 11 |
+
intensity = st.slider("Choose intensity:", min_value=1, max_value=10, value=1)
|
| 12 |
+
|
| 13 |
+
if st.button("Greet Me"):
|
| 14 |
+
result = greet(name, intensity)
|
| 15 |
+
st.success(result)
|