input: Write a function to build a simple blockchain system in Python. The function should define a Block class with an __init__ method to initialize the block attributes (index, timestamp, data, previous_hash) and a hash_block method to compute the hash of the block. It should also include functions to create the blockchain from a list of transactions and to print the blockchain.
  
  
  import hashlib
  import json
  
  # Define the Block class
  class Block:
      def __init__(self, index, timestamp, data, previous_hash):
          self.index = index
          self.timestamp = timestamp
          self.data = data
          self.previous_hash = previous_hash
          self.hash = self.hash_block()
  
      # Create the hash of the block contents
      def hash_block(self):
          sha = hashlib.sha256()
          sha.update((str(self.index) + 
                      str(self.timestamp) + 
                      str(self.data) + 
                      str(self.previous_hash)).encode('utf-8'))
          return sha.hexdigest()
  
  # Function to create the genesis block
  def create_genesis_block():
      return Block(0, '01/01/2023', 'Genesis Block', '0')
  
  # Function to create the next block
  def next_block(previous_block, data):
      index = previous_block.index + 1
      timestamp = '01/01/2023'
      previous_hash = previous_block.hash
      return Block(index, timestamp, data, previous_hash)
  
  # Create the blockchain
  def create_blockchain(blockchain_transactions):
      blockchain = [create_genesis_block()]
      previous_block = blockchain[0]
  
      # Add blocks for each item in the list of transactions
      for data in blockchain_transactions:
          block_to_add = next_block(previous_block, data)
          blockchain.append(block_to_add)
          previous_block = block_to_add
  
  # Print the blockchain
  def print_blockchain(blockchain):
      for block in blockchain:
          block_index = str(block.index)
          block_timestamp = str(block.timestamp)
          block_data = str(block.data)
          block_hash = block.hash
          print(f"Block Index: {block_index}, Timestamp: {block_timestamp}, Data: {block_data}, Hash: {block_hash}")
  
  assert create_blockchain(["Transaction1", "Transaction2"])
  assert print_blockchain(blockchain)  # Ensure this prints the blockchain details
  
output: def create_blockchain(blockchain_transactions):
      blockchain = [create_genesis_block()]
      previous_block = blockchain[0]
  
      for data in blockchain_transactions:
          block_to_add = next_block(previous_block, data)
          blockchain.append(block_to_add)
          previous_block = block_to_add
  
  def print_blockchain(blockchain):
      for block in blockchain:
          block_index = str(block.index)
          block_timestamp = str(block.timestamp)
          block_data = str(block.data)
          block_hash = block.hash
          print(f"Block Index: {block_index}, Timestamp: {block_timestamp}, Data: {block_data}, Hash: {block_hash}")