# Author: Steven Carr # Last Edited: October 2021 # Checks the input number to see if it is prime import stdio import sys # Accept n (int) as command-line argument. n = int(sys.argv[1]) # Set i (potential divisor of n) to 2. i = 2 # As long as i is less than or equal to n / i... while i <= n / i: if n % i == 0: break i = i + 1 continue if n % i != 0 or n == 2: stdio.writeln(True) # If you got here by exhausting the loop, n is prime. Write True to standard output. else: stdio.writeln(False) # If you got here by prematurely exiting the loop, n is not a prime. Write False to standard # output.