Numerical Comparisons and Combinations Quiz

Numerical Comparisons and Combinations Quiz

This quiz is intended to test your knowledge of the concepts introduced in Numerical Comparisons and Combinations 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

Which statement will be shown after the following code is run?

default num_cookies = 3
label start():
    if num_cookies <= 2:
        "Statement 1"
    elif num_cookies > 3:
        "Statement 2"
    else:
        "Statement 3"
 
 
 
 

Question 2

Which statement will be shown after the following code is run?

default is_sunny = True
default has_tickets = False
label start():
    if is_sunny and has_tickets:
        # Statement 1
        "On such a nice day, you ought to use those tickets to see the city gardens."
    elif is_sunny or has_tickets:
        # Statement 2
        "It was a shame, but it didn't seem like you'd be able to go to the city gardens."
    else:
        # Statement 3
        "With your plans dashed, you decided to watch a movie."
 
 
 
 

Question 3

Which operators can you use in place of ?? in the following conditional statement in order for it to evaluate to True?

default x = 5
label start:
    if x ?? 5:
        "This statement should play."
 
 
 
 
 
 
 
 
 
 
 
 
 

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


Question 1 of 4


If you’d like to know more about the content covered in this quiz, see Numerical Comparisons and Combinations in Ren’Py. If you’d like some extra information on using operators like > and < for strings, check out String Comparisons in Ren’Py, which comes with a very short quiz on the topic. When you’re ready to move on, check out Combining Comparisons in Ren’Py.

Leave a Reply