import sys
import time
def progress_bar():
for i in range(1, 101):
print("\r", end="")
print("Download progress: {}%: ".format(i), "▋" * (i // 2), end="")
sys.stdout.flush()
time.sleep(0.05)
if __name__ == '__main__':
progress_bar()
# 公式法
PI = 0
N = 1000
for n in range(int(N)):
PI += 1/pow(16,n) * (4/(8*n+1) - 2/(8*n+4) - 1/(8*n+5) - 1/(8*n+6))
print(PI)