Last active
September 6, 2019 18:59
-
-
Save vincenzopalazzo/a1b7cb6c8d8facd63ade19a93579067f to your computer and use it in GitHub Desktop.
This code calculate the year in which the bitcoin mining ends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculatesYear(): | |
numbersBlock = 0 | |
blockToHeaving = 210000 | |
starYear = 2008 | |
buildBitcoin = 50 | |
print("-------- Value to start ----------") | |
print("Num. block: ", numbersBlock) | |
print("Num. Block: ", blockToHeaving) | |
print("Miner build bitcoin: ", buildBitcoin) | |
print("Minus value bitcoin: ", format(0.00000001, '.8f')) | |
while buildBitcoin >= float(format(0.00000001, '.8f')): | |
numbersBlock += 1 | |
#print("Block: ", numbersBlock) | |
if numbersBlock > blockToHeaving: | |
print("-------- Having ----------") | |
blockToHeaving += 210000 | |
starYear += 4 | |
buildBitcoin = float(format(buildBitcoin / 2, '.9f')) | |
print("To year", starYear) | |
print("Now the miner build this value bitcoin: ", buildBitcoin) | |
print("Next heaving: ", blockToHeaving) | |
print("-------- Result -------") | |
print("The year finisch bitcoin: ", starYear) | |
if __name__ == '__main__': | |
calculatesYear() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fixed english word