# 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 == "What is the capital of England?":
Cans = "London"
print("nnQuestion " + str(qN) + "n")
ans = input(q + "n")
if ans == Cans:
print("nCorrect")
score += 1
else:
print("nIncorrect")
del q
qN += 1
elif q == "What is the capital of France?":
Cans = "Paris"
print("nnQuestion " + str(qN) + "n")
ans = input(q + "n")
if ans == Cans:
print("nCorrect")
score += 1
else:
print("nIncorrect")
del q
qN += 1
elif q == "What is the capital of Germany?":
Cans = "Berlin"
print("nnQuestion " + str(qN) + "n")
ans = input(q + "n")
if ans == Cans:
print("nCorrect")
score += 1
else:
print("nIncorrect")
del q
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?

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