K0RB1 commited on
Commit
7bd5976
·
1 Parent(s): 03cb253
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -36,24 +36,24 @@ def guess():
36
 
37
  if submit:
38
  if guess.lower() == st.session_state.chosen_name.lower():
39
- st.success(f"CONGRATULATIONS!!! YOU GUESSED IT CORRECTLY! IT IS {st.session_state.chosen_name}")
40
  st.stop()
41
-
42
- if st.session_state.attempts < st.session_state.max_attempts - 1:
43
- st.warning("That's Not Correct. Please Try Again.")
 
 
44
  else:
45
  st.error(f"Sorry, You're Out Of Attempts. The Correct Answer Was {st.session_state.chosen_name}.")
46
  st.stop()
47
 
 
48
  if clear:
49
- del st.session_state.chosen_name
50
- del st.session_state.description
51
- del st.session_state.attempts
52
- del st.session_state.max_attempts
53
-
54
-
55
-
56
- st.session_state.attempts += 1
57
 
58
 
59
 
 
36
 
37
  if submit:
38
  if guess.lower() == st.session_state.chosen_name.lower():
39
+ st.success(f"CONGRATULATIONS!!! You Guessed It Correctly It Is {st.session_state.chosen_name}.")
40
  st.stop()
41
+
42
+
43
+ if st.session_state.attempts < st.session_state.max_attempts -1:
44
+ RA = st.session_state.max_attempts - st.session_state.attempts
45
+ st.warning(f"That's Not Correct. You Have {RA} attempts left .")
46
  else:
47
  st.error(f"Sorry, You're Out Of Attempts. The Correct Answer Was {st.session_state.chosen_name}.")
48
  st.stop()
49
 
50
+
51
  if clear:
52
+ for key in ['chosen_name', 'description', 'attempts']:
53
+ if key in st.session_state:
54
+ del st.session_state[key]
55
+
56
+ st.session_state.attempts += 1
 
 
 
57
 
58
 
59