不带参数求因数(Python 3.11.4 版本可能更好)
import time
temp = int(input('write a number: '))
yee = temp
def factor_no_para():
i = 1
nums = yee
print('%d 的因数是: '%(nums))
while i <= nums:
if nums%i == 0:
print('%d'%(i))
i += 1
factor_no_para()
tt = type(factor_no_para)
print(tt)
time.sleep(10)
{:10_279:}
页:
[1]