ENTER pressed / fixed issue
This commit is contained in:
parent
2b53ec62dc
commit
492a245c34
|
@ -1,6 +1,8 @@
|
|||
import os
|
||||
import csv
|
||||
import random
|
||||
import time
|
||||
|
||||
from rich.console import Console
|
||||
from rich.markdown import Markdown
|
||||
|
||||
|
@ -77,9 +79,10 @@ def _wait_user_answ(answer):
|
|||
return False
|
||||
else: # ===> if only one possible answer
|
||||
result = input("\nWhat is your choice : ")
|
||||
|
||||
if result.lower() == "q" or result.lower() == "quit":
|
||||
return 3
|
||||
if result in answer["ANSWER"]:
|
||||
if result in answer["ANSWER"] and len(result) != 0:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
@ -118,6 +121,7 @@ def main():
|
|||
_display_question(csv_list[count])
|
||||
# Check if correct answer
|
||||
result = _wait_user_answ(csv_list[count])
|
||||
|
||||
if result == 3: # quit!
|
||||
get_out_while = True
|
||||
elif result: # right answer!
|
||||
|
@ -128,5 +132,6 @@ def main():
|
|||
# End of while
|
||||
_stats(csv_list, player)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue