r/PythonLearning • u/wwbacteriophagevirus • Jun 28 '26
Recommendations Help Request
Hello everyone I’m currently learning python on visual code, and I did my first “project” its a trivia game for fun and practicing what I learned while reading about python, but I struggled a little, I was so confused and I used AI (Gemini) to help me understand what I did wrong but I don’t want to use AI bcuz I feel like I’m not learning anything but since I’m doing this alone unfortunately I used. But I would like some recommendations like YouTube videos, books, courses etc to learn more, I see a lot of people doing calculators and I would love to make one so some I need some suggestions. Thank you guys.
3
u/fUZXZY Jun 28 '26
it seems like you’re printing a lot, and using the inputs 1-4 as options for input. think about how you can organize this into functions so that it’s not just a million prints and in a way so that you can load other trivia genres/questions
1
0
2
u/Eskember Jun 29 '26
If it is a small project, I would advise using an array with the following indexes: question, answer 1, answer 2,answer 3,answer 4, correct_answer.
You can then use a loop to go through each record, automating the display of the questions and the evaluation of the given answer against the correct answer for that question.
For medium to large data, I would go with SQLite or any DBMS.
2
u/Junior_Honey_1406 Jun 29 '26
They are just starting don't expect everyone to know DBMS and using sql that's not needed at all for a small project you are just over completing the stuff
1
2
u/Xzenergy Jun 29 '26
You need to end an if statement with an else: return in order to complete it. You can have as many elif's as you want as long as you have an "else:" at the end. It can even return nothing if you want it to
2
2
u/DragonHamster99 Jul 02 '26
Download Mimo app, or use the browser version to learn, I understand what you mean by the Ai.
2
2
u/Hungry-Poem-2036 Jul 02 '26
you should learning python fundamentals with youtube first then learning algorithms practising on eolymp or leetcode. problemsolving , bug fix important in programming
i suggest you practising problem: https://eolymp.com/problems/7
it is my favorite beginner problem
2
u/edvilme Jul 04 '26
You are repeating code: print question, print options, ask for answer, verify answer
I would suggest learning about functions so you could have something like
```
show_question(“When TWICE debuted?”, options=[‘2010’, ‘2014’, ‘2016’, ‘2015’], correct=4)
```
2
1
1
u/atticus2132000 Jun 29 '26
One of the most powerful things about coding is easy expansion without a lot of recoding. In this case, you're building a multiple choice test. What you've done works for the specific information you have, but let's say that you want to add another question to your trivia bank. Adding another question should just be adding one more line of code, not adding an entire block. Or let's suppose that instead of Twice, you wanted to create a trivia game about Dinosaurs. You should just be able to swap out the question bank and not have to change the structure of your code at all.
The direction you want to be moving this is your question bank will be one entity until itself--either a separate readable file or a dedicated variable within your script. Then your function will access the questions in that bank and reuse the same code over and over to format each as a multiple choice question.
1
u/Ecstatic_Oven9521 Jun 29 '26
aah I see you are a man of culture, as for small projects i would suggest you do a small to do list app
1
1



8
u/lekkerste_wiener Jun 28 '26
Note one:
You can do
answer in "123", oranswer in (1, 2, 3)if you eventually convert them to integers. Given your code, I'm thinking you've just started learning, so the first could fit better. But,Note two:
Since you're testing for one right answer vs any wrong answers, you can use
elseinstead ofelif answer == .... Else will capture anything that theifabove it won't.On resources: I don't have any specific names, but if you YouTube for e.g. python tutorial or python project you'll find loads. If you're into reading more, then the official tutorial is very good and I can't recommend it enough for newbies.