# Exercise: Primeness (Function)¶

Modify the prime number detection program from here or here as follows.

• Push the prime number checking algorithm into a function. (is_prime() is a likely name for the function.)

• The function takes the number-to-test-for-primeness as parameter.

• The function returns whether the number-to-check is prime (a boolean value)

• The rest of the program (taking the number from the commandline, or using input() to prompt the user for the number) remains intact. The only change is that the new function is called with the number as parameter, rather than implement the algorithm in top level code.