mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2025-02-16 17:42:06 +00:00
print() and range() for Python 3
This commit is contained in:
parent
06ecaf9168
commit
bdc3743e30
@ -6,7 +6,7 @@ import hashlib
|
|||||||
text = "I am Satoshi Nakamoto"
|
text = "I am Satoshi Nakamoto"
|
||||||
|
|
||||||
# iterate nonce from 0 to 19
|
# iterate nonce from 0 to 19
|
||||||
for nonce in xrange(20):
|
for nonce in range(20):
|
||||||
|
|
||||||
# add the nonce to the end of the text
|
# add the nonce to the end of the text
|
||||||
input = text + str(nonce)
|
input = text + str(nonce)
|
||||||
@ -15,4 +15,4 @@ for nonce in xrange(20):
|
|||||||
hash = hashlib.sha256(input).hexdigest()
|
hash = hashlib.sha256(input).hexdigest()
|
||||||
|
|
||||||
# show the input and hash result
|
# show the input and hash result
|
||||||
print input, '=>', hash
|
print(input, '=>', hash)
|
||||||
|
Loading…
Reference in New Issue
Block a user