logo CodeStepByStep logo


Language/Type: Python assertions logic
Author: Allison Obourn (on 2016/10/24)

For each of the five points labeled by comments, identify each of the assertions in the table below as either being always true, never true, or sometimes true / sometimes false.

def mystery4(a):
    x = 2

    # Point A
    while x < a:
        # Point B
        if a % x == 0:
            a = a // x
            x = 2
            # Point C
            x += 1
            # Point D

    # Point E
    return a

Fill in each box of the the table below with ALWAYS, NEVER or SOMETIMES.

x > 2 x < a a % x == 0
Point A
Point B
Point C
Point D
Point E

You must log in before you can solve this problem.

Log In

Need help?

If you do not understand how to solve an exercise or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect tests, etc.), please

Is there a problem? Contact a site administrator.

©, all rights reserved.