DOMMETI commited on
Commit
cffd70d
·
verified ·
1 Parent(s): fb64e36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -69,8 +69,16 @@ def mode(*args):
69
  else:
70
  return 'multimode'
71
 
72
- # Call the mode function with specific arguments
73
- result = mode(1, 2, 3, 3, 3)
74
 
75
- # Display the result
76
- st.write("Mode result:", result)
 
 
 
 
 
 
 
 
 
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.")