Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,8 +69,16 @@ def mode(*args):
|
|
| 69 |
else:
|
| 70 |
return 'multimode'
|
| 71 |
|
| 72 |
-
#
|
| 73 |
-
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
else:
|
| 70 |
return 'multimode'
|
| 71 |
|
| 72 |
+
# Collect user input
|
| 73 |
+
numbers_input = st.text_input("Enter a list of numbers separated by commas (e.g., 1, 2, 2, 3, 4):")
|
| 74 |
|
| 75 |
+
if numbers_input:
|
| 76 |
+
# Convert the input string to a list of integers
|
| 77 |
+
try:
|
| 78 |
+
list1 = list(map(int, numbers_input.split(',')))
|
| 79 |
+
# Call the mode function with the list of integers
|
| 80 |
+
result = mode(*list1)
|
| 81 |
+
# Display the result
|
| 82 |
+
st.write("Mode result:", result)
|
| 83 |
+
except ValueError:
|
| 84 |
+
st.write("Please enter a valid list of numbers separated by commas.")
|