Repository

codebasics/py

Repository to store sample python programs for python learning
5901 15172 335 65
  • 000
import os,sys,time,requests,json,random from colorama import Fore,Back,init B = Fore.BLUE W = Fore.WHITE R = Fore.RED G = Fore.GREEN BL = Fore.BLACK Y = Fore.YELLOW #warna ngab Hijau="\033[1;92m" putih="\033[1;97m" abu="\033[1;90m" kuning="\033[1;93m" ungu="\033[1;95m" merah="\33[37;1m" biru="\033[1...
  • 000
import hashlib def hashGenerator(data): result=hashlib.sha256(data.encode()) return result.hexdigest() class Block: def init(self,data,hash,prev_hash): self.data=data self.hash=hash self.prev_hash=prev_hash class Blockchain: def init(self): hashLast=hashGenerator('gen_last') hashStart=hashGenerator(...