Python sample quiz

Jessa Gavilla
3 min readSep 25, 2020

--

I tried creating this short Python quiz during our class last week but it took me a lot of time to try and make it work so I also took some extra tutorials online to see how it works :D

I created a short quiz on how much knowledge people have on millennial words/terms and here is the code:

To be honest, getting an error due to syntax and indentation was so common for me. It was really frustrating to try and try and try again. Even the formatting with the proper spacing in the question and answers took a while for me :(

Learning how to code requires great practice and I think practicing on different kind of activities/projects in python is a must. I still get confused on the proper indentation, use of () or [], and different other things that are very basic.

Okay so to start with the quiz, I created it in such a wat that the name was asked first prior to starting the quiz

And then the questions:

The comment on the score would change depending on how many correct questions you got:

Even with the if else statement, it took me some time because apparently I have to use == for equals and indentation is really important!

I learned a lot along the way but I had to make a lot of mistakes also! I learned to keep on searching and finding other solutions because if I keep on inputting the same thing, it will yield the same results HAHA. When I encounter some mistakes, I try to see where it went wrong but it takes me time to figure it out and I need the help of Google also.

Now I need to use the code in SPYDER

I retyped the code in SPYDER and it worked

However, there are difference when using spyder like codes can no longer be dragged and dropped unlike in Colab

And if I want to insert text, I can no longer just format it by clicking it to be bold or Italic

I also cannot easily delete codes like I do in notebook where I just click the trash bin icon.

Also, I can no longer segregate codes into blocks like in Colab where I can run it separately. When I use Spyder, the whole code will be ran.

However, there are benefits also like I can open multiple .py files in spyder but in Colab, I have to switch to different tabs. And also, for me, the output looks better in Spyder. It’s just that running codes and typing it is easier in Colab notebook :)

--

--

No responses yet