Hi, here I post the GitHub link to my Python terminal-based quiz game.
Please give me honest feedback and areas and a new way to improve it to make it more better and engaging.
GitHub Repository
Also, I have made documentation as a blog post on Medium do check it out.MEDIUM
5 Likes
Hi @shiv7195. I played the quiz game you have created. It is good. To make it more interactive in the end can’t we ask user if he wants to play again? If he types “Y” or “Yes” then again start the same quiz game and setting score = 0 (new session) and if he presses “N” or “No” – we can keep it as is - just showing him his final score.
Thanks alot for writing and I am glad you enjoyed the game . You must be an Iron man(are you?)
Yes that’s very good suggestion for sure I will add a functionality ask user if he wants to play again with a simple Y or N
Hi @shiv7195 !
Very nice job!
To make your program run smoothly, add the option to allowed capital letter in the input. At the moment, if you answer correctly but use capital letter, the game finished. The same is happen if the user, by mistake, doesn’t insert any input. Try to notice them that they didn’t put any answer yet and wait for the answer. You can even ask them if they want end the game before reach the end of the 10 questions.
Thanks for the feedback it’s a great help and means alot to me
Can you guide me how to wait and say if the user haven’t put any option
And would it be good to add after every question if he wants to end the quiz NOW
Happy to hear that!
You can use the while True:
loop to wait for a valid input. This loop is an infinite loop: it will run until something is breaking it (finally the user insert a valid input).
N = 10
Sum = 0
# This loop will run forever
while True:
Sum += N
N -= 1
# the below condition will tell
# the loop to stop
if N == 0:
break
print(f"Sum of First 10 Numbers is {Sum}") # 55
To prevent the program to sadly stop, use the try: expect:
blocks: the program will try to execute the command and, if an error occur, the program will not crush but will inform the user that “An error occur”.
Here an example where it will return a NameError as x is not defined:
try:
print(x)
except NameError:
print("Variable x is not defined")
except:
print("Something else went wrong")
You can read more information about the while
loop and the try / expect
blocks in those pages:
while
loop Page
try / expect
blocks Page
Happy Coding!
1 Like
Awesome job! That’s a huge accomplishment
1 Like