Created
July 27, 2017 18:31
-
-
Save jgarciabu/e282aad8b3ba34c0055394c716fd5f97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Jul 27 13:53:35 2017 | |
@author: Jeff Garcia | |
Create a program that asks the user for a number and then prints out a list of | |
all the divisors of that number. (If you don’t know what a divisor is, it is a | |
number that divides evenly into another number. For example, 13 is a divisor of | |
26 because 26 / 13 has no remainder.) | |
""" | |
a = int(input("Please enter a number:")) | |
b = [] | |
for x in range(1, a + 1): | |
if a % x == 0: | |
b.append(x) | |
print(b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment