Python代码计算整数各位数字的乘积
num = int(input('请输入一个整数: '))
digits = [int(digit) for digit in str(num)]
product = 1
for digit in digits:
product *= digit
print(product)
运行上述代码,输入一个整数,程序会计算其各位数字的乘积,并输出结果。
原文地址: https://www.cveoy.top/t/topic/WNa 著作权归作者所有。请勿转载和采集!