input: Write a function to generate a neural network model using TensorFlow and Python for classifying hand-written digits from the MNIST dataset. If the dataset is loaded correctly and the model is trained, return True; otherwise, return False. If the function runs without errors, it should print the training progress and the final accuracy on the test set.
  assert classify_mnist()==True
  assert classify_mnist()==True
  assert classify_mnist()==True
  assert classify_mnist()==True
  assert classify_mnist()==True
output: 
  def classify_mnist():
      import tensorflow as tf
      from tensorflow.keras import layers, models
      from tensorflow.keras.datasets import mnist
  
      (x_train, y_train), (x_test, y_test) = mnist.load_data()
      if x_train is None or x_test is None:
          return False
  
      x_train = x_train.reshape((60000, 28, 28, 1)).astype('float32') / 255
      x_test = x_test.reshape((10000, 28, 28, 1)).astype('float32') / 255
      y_train = tf.keras.utils.to_categorical(y_train, 10)
      y_test = tf.keras.utils.to_categorical(y_test, 10)
  
      model = models.Sequential([
          layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)),
          layers.MaxPooling2D((2, 2)),
          layers.Conv2D(64, (3, 3), activation='relu'),
          layers.MaxPooling2D((2, 2)),
          layers.Conv2D(64, (3, 3), activation='relu'),
          layers.Flatten(),
          layers.Dense(64, activation='relu'),
          layers.Dense(10, activation='softmax')
      ])
  
      model.compile(optimizer='adam',
                    loss='categorical_crossentropy',
                    metrics=['accuracy'])
  
      model.fit(x_train, y_train, epochs=5, batch_size=64, verbose=1)
      test_loss, test_acc = model.evaluate(x_test, y_test, verbose=0)
      print(f'Test accuracy: {test_acc:.4f}')
  
      return True
  