“Blockchain.py” Code-Antworten

Blockchain.py

{
 "sender": "my address",
 "recipient": "someone else's address",
 "amount": 5
}
Courageous Caribou

Blockchain.py

from hashlib import sha256
x = 5
y = 0  # We don't know what y should be yet...
while sha256(f'{x*y}'.encode()).hexdigest()[-1] != "0":
    y += 1
print(f'The solution is y = {y}')
Courageous Caribou

Blockchain.py

$ python blockchain.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Courageous Caribou

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen