# 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入門練習(xí)題 4/2 - 整除第4題:整除 難度系書:** 接受用戶輸入一個(gè)整數(shù),列出能被該整數(shù)整除的所有數(shù)吏饿。 知識(shí)點(diǎn) 整除 期待你的答案 !!!