input: Write a function to create a simple blockchain system in Python. The function should define a Block class with attributes index, timestamp, data, previous_hash, and hash. It should also include methods to create the blockchain and print its contents. The blockchain should start with a genesis block and add subsequent blocks based on a list of transactions.
  
  
  def create_simple_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()
  
      # Create the genesis block
      def create_genesis_block():
          return Block(0, "01/01/2023", "Genesis Block", "0")
  
      # Create the next block in the chain
      def next_block(last_block, data):
          this_index = last_block.index + 1
          this_timestamp = "01/01/2023"
          this_data = data
          this_hash = last_block.hash
          return Block(this_index, this_timestamp, this_data, this_hash)
  
      # Define a list of transactions for the blockchain
      blockchain_transactions = ["Transaction 1", "Transaction 2", "Transaction 3"]
  
      # Create the blockchain
      def create_blockchain():
          blockchain = [create_genesis_block()]
          previous_block = blockchain[0]
  
          # Add blocks for each item in the list of transactions
          for i in range(1, len(blockchain_transactions)):
              block_to_add = next_block(previous_block, blockchain_transactions[i])
              blockchain.append(block_to_add)
              previous_block = block_to_add
  
      blockchain = create_blockchain()
  
      # 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("Block Index: " + block_index)
              print("Timestamp: " + block_timestamp)
              print("Data: " + block_data)
              print("Hash: " + block_hash + "\n")
  
      print_blockchain(blockchain)
  
  # Test case
  create_simple_blockchain()
  assert len(blockchain) == 4  # Genesis block + 3 transactions
  assert blockchain[0].hash == blockchain[1].previous_hash  # Genesis block hash matches the next block's previous hash
  
output: 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()
  
  # Create the genesis block
  def create_genesis_block():
      return Block(0, "01/01/2023", "Genesis Block", "0")
  
  # Create the next block in the chain
  def next_block(last_block, data):
      this_index = last_block.index + 1
      this_timestamp = "01/01/2023"
      this_data = data
      this_hash = last_block.hash
      return Block(this_index, this_timestamp, this_data, this_hash)
  
  # Define a list of transactions for the blockchain
  blockchain_transactions = ["Transaction 1", "Transaction 2", "Transaction 3"]
  
  # Create the blockchain
  def create_blockchain():
      blockchain = [create_genesis_block()]
      previous_block = blockchain[0]
  
      # Add blocks for each item in the list of transactions
      for i in range(1, len(blockchain_transactions)):
          block_to_add = next_block(previous_block, blockchain_transactions[i])
          blockchain.append(block_to_add)
          previous_block = block_to_add
      return blockchain
  
  blockchain = create_blockchain()
  
  # 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("Block Index: " + block_index)
          print("Timestamp: " + block_timestamp)
          print("Data: " + block_data)
          print("Hash: " + block_hash + "\n")