# 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.)
num = int(input("please input a number"))
divisors = [item for item in range(1, num+1) if num%item == 0]
print(divisors)
Python入门练习题 4/2 - 整除第4题:整除 难度系书:** 接受用户输入一个整数,列出能被该整数整除的所有数。 知识点 整除 期待你的答案 !!!