Okay, so today I’m gonna walk you through how I messed around with some psychology trivia questions. It was a fun little project, and I learned a bunch, so let’s get into it.
First off, I needed some questions, right? So, I just straight-up Googled “psychology trivia questions.” Found a ton of lists online, some easy, some crazy hard. I copied a bunch into a text file. Nothing fancy, just raw questions and answers.
Next, I decided I wanted to do something a bit more interactive than just reading them off a screen. My first thought was a simple command-line quiz. So, I fired up Python – my go-to for quick and dirty scripting. I literally just started typing.
Here’s the basic flow I roughed out:
- Load the questions from the text file.
- Randomly pick a question.
- Display the question to the user.
- Get the user’s answer.
- Check if the answer is correct.
- Give feedback (correct or incorrect).
- Keep score.
The loading part was easy. Just read the file line by line, split each line into a question and answer pair. I used a simple “Q: ” and “A: ” separator in my text file to make this easier. It was janky, but it worked.
Then came the “randomly pick a question” part. Python’s random
module made this a breeze. I just chose a random index from the list of questions.
Displaying the question and getting the user’s input was just a matter of using print()
and input()
. Super basic stuff.
The “check if the answer is correct” part was the trickiest. I quickly realized that people type all sorts of weird things. So, I did a little bit of string cleaning. Lowercased everything, removed leading/trailing whitespace. Still, it wasn’t perfect. Sometimes people would give a slightly different answer that was still correct. I didn’t bother with fuzzy matching or anything too fancy. Just a simple string comparison.
Giving feedback was just another print()
statement. And keeping score was just a matter of incrementing a variable when the user got a question right.

I wrapped all of this up in a while
loop so the quiz would keep going until the user got bored and quit. I added a little “exit” command to break out of the loop.
After that, I thought, “Hey, this is kinda cool, maybe I can make it into a little web app?” I knew I didn’t want to spend a ton of time on it, so I went with Flask – again, for quick and dirty prototyping.
The web app version was pretty similar to the command-line version, but with a web interface. I used HTML forms to display the questions and get the user’s answers. And I used Flask’s session object to keep track of the score and the current question.
The most annoying part was styling it. I’m no designer, so I just grabbed a basic CSS template off the internet and tweaked it a bit. It still looks kinda ugly, but it’s functional.
I never bothered deploying it anywhere. It was just a fun little personal project. But I learned a lot about psychology, and I got some practice with Python and Flask. Plus, it was a good excuse to procrastinate on other things.
Lessons Learned:
- Even simple projects can be surprisingly fun and educational.
- Don’t be afraid to start with a janky solution. You can always refactor later.
- String comparison is harder than it looks.
- I still suck at CSS.
That’s pretty much it. Nothing earth-shattering, but hopefully, it was interesting. Maybe it’ll inspire you to try something similar.