Skip to content

Instantly share code, notes, and snippets.

@TheMuellenator
Created January 14, 2020 11:49
Show Gist options
  • Save TheMuellenator/35d8c02838fb3728c3252d793e5d764b to your computer and use it in GitHub Desktop.
Save TheMuellenator/35d8c02838fb3728c3252d793e5d764b to your computer and use it in GitHub Desktop.
Python Conditional Statement Coding Exercise Solution
def is_it_prime(n):
#TODO: Write your code here.
for i in range (2, n):
if n % i == 0:
return False
else:
return True
@umaretiya
Copy link

def is_prime(n):
for i in range(2, n\2+1):
if n % i == 0:
return False
else:
return True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment