Skip to main content

Command Palette

Search for a command to run...

Project -1 : Quiz Game in Python

Updated
2 min readView as Markdown

PROJECT-1 : Quiz Game

Link to see the code:

https://www.youtube.com/watch?v=_bKxBjSyRUA

Problems that I encountered

  1. Finding which function or a library to use for checking the accuracy of the input with actual answer.

  2. Ignore the small alphabetical mistakes form the users finding the library and using its function.

  3. How to ignore the Case sensitivity.

  4. How to use elif and nested else if

Functions that I have used

  1. if-else: Used to apply conditions. The result it gives is either True or False.

  2. elif: instead of else if we can shortly write 'elif' and give a condition if needed it shortens the length of the code.

  3. from ___ import ___ : This function allows us to input libraries and allow us to use function in the code from that library

  4. fuzzywuzzy : It is a library, i.e., This approach is more robust for handling minor typos and variations in user input. # It reduces dependency on external libraries specifically designed for spelling correction, making it more suitable for technical terms and acronyms. # #Using fuzzy matching can provide a more user-friendly experience by allowing slight errors without compromising the integrity of the quiz.

  5. fuzz.ratio(answer , correct_answer): It will check the input answer with the correct_anwer and will save it in the ratio form ex:- 80%, 50% ...

  6. lower() :This function converts the string into a lower case letters.

  7. upper(): This function converts the string into an upper case letters.

  8. Dictionary : [("key" , "value"), ('key' , 'value')]

  9. for loop: It loops until there is no value left.

  10. quit(): This function is used to end the programme

  11. play_quiz(): This is a user defined function which can be called form anywhere.

What I Learned

  1. I Learned how to install the library fuzzywuzzy and use its function i.e., fuzzy.ratio(answer, correct_answer)

  2. How to search for solutions for an error on Stack overflow

  3. using nested else-if

  4. How we can use dictionary in for loop

More from this blog

Let see

16 posts