Skip to content

Instantly share code, notes, and snippets.

@Just-Simple-59
Last active June 22, 2021 18:11
Show Gist options
  • Save Just-Simple-59/21f41179287f017fc1ef6e9bfdadf36f to your computer and use it in GitHub Desktop.
Save Just-Simple-59/21f41179287f017fc1ef6e9bfdadf36f to your computer and use it in GitHub Desktop.
Create a program that asks the user for a number and then prints out a list of all the divisors of that number.
Number = int(input("Enter a random number\n"))
Check = range(2, 11)
empty = []
for element in check:
if number % element == 0:
empty.append(element)
print("The number" + ' ' + str(number) + ' ' + "you entered"
" is a divisor of this number(s)" + ' ' + str(empty))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment