Tính số pi
#chuong trinh tinh so pi
import time
t1=time.time()
p=0
i=0
n=6
sohang=(-1)**i/(2*i+1)
while abs(sohang)>10**(-n):
p += sohang
i += 1
sohang = (-1)**i/(2*i+1)
print(p*4)
t2=time.time()
print('Thoi gian thuc hien: {} s '.format(t2-t1))
https://tritue.edu.vn/tuecode/tracnghiem30/site/data/YVdRc01qSTFMRjl5YjNWMFpTeGlZV2wyYVdWMEwzQnZjM1F2ZG1sbGR3PT0%3D