← Back to the Introduction to Computer Science outline The Course Maker
← Introduction to Computer Science outline
Week 4 · Quiz

Week 4 Quiz

Introduction to Computer Science Free sample edition
The student view of the 10-question quiz: each question and its options as they appear in Canvas. The answer key and the feedback ship only inside the course's .imscc (Classic QTI); they are not shown on this public page.
  1. The reading log asks two questions. What does this program print, line by line?

    goal = 300
    pages_read = 45
    print(pages_read >= goal)
    print(pages_read != 45)

    Select one.

    • False False
    • True False
    • False True
    • True True
  2. == compares values. What does this line print?

    print(3 == 3.0, "3" == 3)

    Select one.

    • True True
    • False False
    • False True
    • True False
  3. A truth table lists its rows as a, b in the order True True, True False, False True, False False. On which row does a or b give False?

    Select one.

    • True True
    • True False
    • False True
    • False False
  4. Work it out in Python's order. What does this line print?

    print(True or False and False)

    Select one.

    • False
    • True
    • None
    • SyntaxError
  5. The expression not a or b is worked out down the four rows of a truth table (a, b = True True, True False, False True, False False). Which list gives its value on each row, in order?

    Select one.

    • True, False, True, True
    • False, False, False, True
    • False, True, True, True
    • True, True, False, True
  6. What does the reading log's Week 4 stage print?

    goal = 300
    pages_read = 45
    if pages_read >= goal:
        print("Goal met")
    elif pages_read >= goal // 2:
        print("Halfway or better")
    else:
        print("Keep going")

    Select one.

    • Goal met
    • Halfway or better
    • Keep going
    • Halfway or better, then Keep going
  7. Trace the chain from the top. What does this program print?

    x = 7
    if x > 10:
        print("big")
    elif x > 5:
        print("medium")
    else:
        print("small")

    Select one.

    • big
    • medium
    • small
    • medium, then small
  8. What happens when you run this program?

    x = 5
    if x = 5:
        print("yes")

    Select one.

    • It prints yes.
    • Nothing runs, and the error names SyntaxError.
    • It prints nothing and shows no error.
    • It prints yes, then the error names TypeError.
  9. Select every statement that is true about this program.

    total = 95
    if total >= 60:
        print("D or better")
    elif total >= 90:
        print("A")
    else:
        print("F")

    Select every option that applies.

    • It prints D or better.
    • It has a logic error.
    • It has a syntax error.
    • Moving the total >= 90 test first makes it print A.
    • It prints D or better and then A.
  10. True or false: this line prints False True.

    print(bool(""), bool("0"))

    True or false.

    • True
    • False

Built with The Course Maker · samples.thecoursemaker.com