From bdc3743e30c54e2abf3466e9c10a0fb7db7d629b Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 24 Aug 2017 18:22:28 +0200 Subject: [PATCH] print() and range() for Python 3 --- code/hash_example.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/hash_example.py b/code/hash_example.py index 12012ac7..289628b0 100644 --- a/code/hash_example.py +++ b/code/hash_example.py @@ -6,7 +6,7 @@ import hashlib text = "I am Satoshi Nakamoto" # 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 input = text + str(nonce) @@ -15,4 +15,4 @@ for nonce in xrange(20): hash = hashlib.sha256(input).hexdigest() # show the input and hash result - print input, '=>', hash \ No newline at end of file + print(input, '=>', hash)