Equality Comparison Quiz

Equality Comparison Quiz

This quiz is intended to test your knowledge of the concepts introduced in Equality Comparisons in Ren’Py. Explanations are provided for each answer, and you can take the quiz as many times as you like.

It’s okay if you don’t know the answers to every quiz question, even after going through the tutorials. Some quiz questions are there to point out common errors or mistakes and teach you how to identify and fix them. If you don’t understand a question, feel free to skip it and read the explanation after submitting the quiz. There’s a free question box at the end of the quiz if you have any comments, questions, or feedback.


Question 1

What line(s) of dialogue will be shown to the player when the following code is executed?

(If there is more than one answer, your answer may be “Lines 6 and 7”, for example).

default name = ""
label start():
    if not name:
        $ name = "Fen"
        # Line 1
        "So your name is [name], huh?"
    elif name != "Xia":
        # Line 2
        "At least your name isn't Xia."
    elif name == "Fen":
        # Line 3
        "Oh how interesting, I thought you looked like a Fen."
    else:
        # Line 4
        "So your name is [name], then?"
    return
 
 
 
 
 

Question 2

What line(s) of dialogue will be shown to the player when the following code is executed?

(If there is more than one answer, your answer may be “Lines 6 and 7”, for example).

default num_wins = 3
label start():
    if num_wins:
        # Line 1
        "You won [num_wins] games!"

    if num_wins = 0:
        # Line 2
        "Maybe you'd do better next time."
    elif num_wins = 1:
        # Line 3
        "One win seemed decent."
    else:
        # Line 4
        "You were happy to leave it at [num_wins] wins."
 
 
 
 
 

Question 3

What line(s) of dialogue will be shown to the player when the following code is executed?

(If there is more than one answer, your answer may be “Lines 6 and 7”, for example).

default mood = "Happy"
label start():
    if mood != "sad":
        # Line 1
        "The weather seemed nice outside; a little crisp, but it might warm up later."
    else:
        # Line 2
        "The weather outside was gloomy, like it might rain."

    if mood == "happy":
        # Line 3
        "It put a little spring in your step as you walked to the park."
    else:
        # Line 4
        "You strolled down the street at a leisurely pace."
 
 
 
 
 

Question 4

Suppose we have a variable, owns_dog, which is True if the player owns a dog and False otherwise. If we want to check whether the player does NOT own a dog, what is the best way to do so?

 
 
 
 
 
 
 
 

(Optional) Do you have any feedback on the lesson or the quiz?


Question 1 of 5


If you’d like to know more about the content covered in this quiz, see Equality Comparisons in Ren’Py. If you’d like a bit of bonus information on booleans and strings, you can take a look at Booleans vs Strings before moving on to Numerical Comparisons and Combinations in Ren’Py.

Leave a Reply