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

Week 11 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. Predict, then check: what does this program print?

    s = "Hello"
    s.upper()
    print(s)

    Select one.

    • HELLO
    • Hello
    • None
    • hello
  2. Predict, then check: what does this program print?

    entry = "day 3: 25 pages"
    parts = entry.split()
    print(parts)

    Select one.

    • ['day', '3:', '25', 'pages']
    • ['day', '3', '25', 'pages']
    • ['day 3: 25 pages']
    • ['day', '3:', 25, 'pages']
  3. Predict, then check: what does this program print?

    entry = "day 3: 25 pages"
    parts = entry.split()
    pages = int(parts[2])
    print(pages + 5)

    Select one.

    • 255
    • 30
    • TypeError
    • 25
  4. Predict, then check: what does this program print?

    print("a,b c".split())

    Select one.

    • ['a', 'b', 'c']
    • ['a', 'b c']
    • ['a,b', 'c']
    • ['a,b c']
  5. Predict, then check: what does this program print?

    s = "Hello, World"
    print(s.find("z"))

    Select one.

    • False
    • −1
    • 0
    • None
  6. Predict, then check: what does this program print?

    s = "Hello, World"
    if s.find("z"):
        print("found a z")
    else:
        print("no z")

    Select one.

    • found a z
    • no z
    • TypeError
    • Nothing prints
  7. Predict, then check: what does this program print?

    note = "buy milk, buy eggs, buy bread"
    print(note.replace("buy", "get"))

    Select one.

    • get milk, buy eggs, buy bread
    • buy milk, buy eggs, buy bread
    • get milk, get eggs, get bread
    • get milk, get eggs, buy bread
  8. Predict, then check: what does this program print?

    print("hello"[::-1])

    Select one.

    • h
    • olle
    • hello
    • olleh
  9. Select every line this program prints.

    typed = "  Yes "
    print(typed == "yes")
    clean = typed.strip().lower()
    print(clean)
    print(clean == "yes")

    Select every option that applies.

    • False
    • yes
    • True
    • Yes
    • Yes
  10. True or false: in s = "Hello, World", counting positions from 0, the letter W sits at position 7, which is why s.find("W") prints 7.

    True or false.

    • True
    • False

Built with The Course Maker · samples.thecoursemaker.com