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。
自己试着做一下哦