Spaces:
Sleeping
Sleeping
updated
Browse files
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!!!
|
40 |
st.stop()
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
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 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
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 |
|