Created
February 28, 2017 18:42
-
-
Save hiramf/ecc569963d6f8f517a176370ec643bbf to your computer and use it in GitHub Desktop.
Practice Python: Exercise 4
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
b = int(input("please enter an integer:\n")) | |
print ("The divisors for " + str(b) + " are: ") | |
for i in range(1,b+1): | |
if b%i==0: | |
print(i) | |
x = [i for i in range(1,b+1) if b%i==0] | |
print("here is a list of your divisors for " + str(b) + ":\n" + str(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment