Spaces:
Build error
Build error
updated app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
import streamlit as st
|
| 5 |
+
|
| 6 |
+
# streamlit run 2_Hello.py
|
| 7 |
+
|
| 8 |
+
st.title('String Operations')
|
| 9 |
+
|
| 10 |
+
firstName = st.text_input('Enter your first name: ')
|
| 11 |
+
lastName = st.text_input('Enter your second name: ')
|
| 12 |
+
|
| 13 |
+
def display_fullname(firstName, lastName):
|
| 14 |
+
fullname = f"{firstName} {lastName}"
|
| 15 |
+
|
| 16 |
+
st.write(f"Full name: {fullname}")
|
| 17 |
+
|
| 18 |
+
if st.button("Submit"):
|
| 19 |
+
if firstName and lastName:
|
| 20 |
+
display_fullname(firstName, lastName)
|
| 21 |
+
else:
|
| 22 |
+
st.write("Please enter both first name and last name.")
|