Skip to content

Instantly share code, notes, and snippets.

@bharathmuddada
Created May 26, 2021 05:14
Show Gist options
  • Save bharathmuddada/d5b437b3438088caaaf584a48cc93268 to your computer and use it in GitHub Desktop.
Save bharathmuddada/d5b437b3438088caaaf584a48cc93268 to your computer and use it in GitHub Desktop.
Smallest Divisor of a number which is greater than 1 in python
number = int(input("Enter your number \n"))
for i in range(2, number + 1):
if number % i == 0:
print(i, "is smallest divisor")
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment