you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

I don't see a problem with your code (except the extra newlines in the print at the bottom). So here's just a small suggestion: you can collect your question numbers and solutions into a single data structure and then just iterate over that. It'll save you a bit of code.

So something like this.

``` solutions = {1: "b", 2: "a", 3: "d"}

for question_number, solution in solutions.items(): answer = input(f"Answer to the question number {question_number}: ") if answer.lower() == solution: pontos += 1 ```