From 7b7ceed49c54ed39bae154b5857f0915b7602056 Mon Sep 17 00:00:00 2001 From: EstefaniaGallegos616 <54247200+EstefaniaGallegos616@users.noreply.github.com> Date: Mon, 19 Aug 2019 10:52:29 -0500 Subject: [PATCH] primes.py --- primes.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/primes.py b/primes.py index 1f4596d..b19489f 100644 --- a/primes.py +++ b/primes.py @@ -1,16 +1,16 @@ -""" -Your module documentation here -""" - - class PrimeClass(object): - """ - Your class documentation here - """ - - def is_prime(self, num_int): - """ - Your method documentation here - """ - # your primes code here - return "not implement yet" # Remove this dummy line + num_int=int(input("Enter a number:")) + + if num_int <= 1: + print (num_int,"is not prime") + else: + a=2 + check = True + while a != num_int: + if num_int%a == 0: + print (num_int, "is not prime") + check = False + break + a+=1 + if check == True: + print (num_int,"is prime")