DOMMETI commited on
Commit
71d19e8
·
verified ·
1 Parent(s): f7d4ed6

Update pages/2_Events.py

Browse files
Files changed (1) hide show
  1. pages/2_Events.py +8 -2
pages/2_Events.py CHANGED
@@ -102,13 +102,19 @@ if st.button('Start the Experiment: Will it Rain or Not?',key="start_experiment_
102
  st.subheader("COMPOUND EVENT")
103
  st.markdown("An event is said to be a compoud event when an event gives more than on event.")
104
  st.title("Example of Compound Event")
105
- list1=[1,2,3,4,5,6]
 
 
 
 
 
 
 
106
  set1=[]
107
  for i in list1:
108
  if i%2==0:
109
  set1.append(i)
110
  else:
111
  pass
112
- st.write(f"Rollig a die will have favorable outcome : [1,2,3,4,5,6]")
113
  st.write(f"Event: Rolling a die and getting even number:{set1}")
114
 
 
102
  st.subheader("COMPOUND EVENT")
103
  st.markdown("An event is said to be a compoud event when an event gives more than on event.")
104
  st.title("Example of Compound Event")
105
+ numbers_input_4 = st.text_input("Enter a list of numbers separated by commas (e.g., 1, 2, 3, 4, 5):", key="numbers_input_4")
106
+ if numbers_input_4:
107
+ parts=numbers_input_4.split(",")
108
+ list1=[]
109
+ for i in parts:
110
+ i = i.strip()
111
+ if i.isdigit():
112
+ list1.append(int(i))
113
  set1=[]
114
  for i in list1:
115
  if i%2==0:
116
  set1.append(i)
117
  else:
118
  pass
 
119
  st.write(f"Event: Rolling a die and getting even number:{set1}")
120