比特币总量计算公式
#!/usr/bin/env python
"""
desc : calculate the total amount of BitCoin
time : 2018-2-10 00:02:17
author : bsqql123@163.com
"""
sum = 0
# 50个比特币,等于5,000,000,000 聪,聪是比特币的最小单位
size = 50 * 10000000
index = 0
while (size >= 1):
index += 1
size = int(size)
sum += 210000 * size
print(f"第{index}次减半,每个区块产生的比特币为{size},产生的总量为:{sum}")
size = size / 2
网友评论