# Assignment 8
# Name:
# Date:
#
# Task A: Make the LEAST number of changes to the function isPrime1(x)
# such that the function returns True if x is a prime number and False
# otherwise. There may be a few logical errors. Add comments to the lines
# that you modified. Assume that x is NOT an exceptional value.
def isPrime1(x):
derp = x
while (derp >= 2):
if (x % derp):
return(False)
derp -= 1
return(True)
# Task B: Write a function called isPrime2(x) such that the function:
# a) returns True if x is a prime number and False otherwise;
# b) handles exceptional values of x;
# c) has appropriate variable names and comments; and
# d) minimizes the number of steps when returning True.
# Task C: Between the triple quotes below, write a well-written paragraph
# less than 120 words that explains how and why your implementation of
# isPrime2(x) uses a "better" algorithm than isPrime1(x). Use examples
# and be concise.
'''
'''