This file contains hidden or 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
| import hashlib as hasher | |
| import datetime as date | |
| # Define what a Yakcoin block is | |
| class Block: | |
| def __init__(self, index, timestamp, data, previous_hash): | |
| self.index = index | |
| self.timestamp = timestamp | |
| self.data = data | |
| self.previous_hash = previous_hash |
This file contains hidden or 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
| const kelvin = prompt('What is the Kelvin temperature today?'); | |
| // check if input is a number | |
| // NaN = Not-A-Number | |
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN | |
| if (!isNaN(kelvin)) { | |
| var celsius = kelvin - 273; // Kelvin - 273 = Celsius |