Is there an easier way to make a randomised quiz?

I need to make a randomised quiz for an assignment, and have been trying for a long time. I came up with this and its the only one I can get to work:

import random

q = ["What is the capital of England?",
     "What is the capital of France?",
     "What is the capital of Germany?"]

random.shuffle(q)
qN = 1
score = 0

while qN < 4:
    if q[0] == "What is the capital of England?":
        Cans = "London"
        print("nnQuestion " + str(qN) + "n")
        ans = input(q[0] + "n")
        if ans == Cans:
            print("nCorrect")
            score += 1
        else:
            print("nIncorrect")
        del q[0]
        qN += 1
    elif q[0] == "What is the capital of France?":
        Cans = "Paris"
        print("nnQuestion " + str(qN) + "n")
        ans = input(q[0] + "n")
        if ans == Cans:
            print("nCorrect")
            score += 1
        else:
            print("nIncorrect")
        del q[0]
        qN += 1
    elif q[0] == "What is the capital of Germany?":
        Cans = "Berlin"
        print("nnQuestion " + str(qN) + "n")
        ans = input(q[0] + "n")
        if ans == Cans:
            print("nCorrect")
            score += 1
        else:
            print("nIncorrect")
        del q[0]
        qN += 1

print("You scored", score, "out of 3 correct!")

The way I did it seems way too long and I’m sure that there’s a much simpler way but I just can’t seem to find it. Can anyone help?

Answer

A good place to start would be to group your questions and answers using a list of tuples:

quiz = [
    ("What is the capital of England?", "London"),
    ("What is the capital of France?", "Paris"),
    ("What is the capital of Germany?", "Berlin")
]

Then, instead of a while loop, use a for loop:

random.shuffle(quiz)
score = 0

# questions and answers are now paired up
for question, answer in quiz:
    print(question)
    user_answer = input("Answer: ")

    if user_answer.strip() == answer:
        score += 1
        print("Correct")
    else:
        print("Incorrect")


# Use an f-string to format the score and number of questions
print(f"You scored {score} out of {len(quiz)}!")