求python语言编程过程谢谢

2025-06-27 01:54:38
推荐回答(2个)
回答1:

def getThickness(iOrigThickness, iFoldCount):
    multiple = 1
    for i in range(iFoldCount):
        multiple *= 2
    return "%.6f" % float(iOrigThickness * multiple)

times = input("Input folding times: ")
try:
    times = int(times)
except:
    print "Invalid input! A positive integer is required."
else:
    print getThickness(1/float(20000), times)


For python 2。

回答2:

自己试着做一下哦