Python Project: Create Your Own Quiz!

Do you want to quiz friends and family on topics? With the python language, you can code just that!

Want some python rules? Check out Basic Python Rules

Making Your First Question

The first question can be made like the rest. Create a variable first which is a name. Then you want to add an equal sign and following the equal sign, add “input”. The input means the answer that people put in when you add the question is the variable. The question can be added after the input in parentheses and a quotation mark. Inside the quotation mark and the parentheses should be your question.

Heres an example: q1 = input(“How many paws the a bear have?”)

Finding Right or Wrong Answer

You first need to create a new line of code. Use an if statement. It means if your variable equals this than this happens. You need two = symbols after stating your variable. Your code might look similar to this: q1= input(“How many paws does a bear have? “)
if q1 == 4:
If the answer is a number, you want to add q1 = int() to turn the answer into a variable. After each line of code, you want to make a new line underneath it. To print something, you want to say “print” and add parentheses and quotations. You put what you want to say between the quotes. Add your print statement after the colon of the if statement. Like this:
q1 = input(“How many paws does a bear have?”)
q1 = int()
if q1 ==4:
print(“Correct”)
If they’re wrong, you want to use an “else” statement like this:
else:
And then add print afterward.
Your first question will look like this:
q1 = input(“How many paws does a bear have?”)
q1 = int()
if q1 == 4:
print(“Correct”)
else:
print(“Wrong”)

Continue with more…

Coming Soon!

Quiz

Coming Soon!