input: Write a python function to create and train a simple neural network using TensorFlow.
  assert train_and_evaluate_neural_network(x_train, y_train, x_test, y_test, input_dim, classes, learning_rate, training_epochs) >= 0.0
output: def train_and_evaluate_neural_network(x_train, y_train, x_test, y_test, input_dim, classes, learning_rate, training_epochs):
      import tensorflow as tf
      from tensorflow.keras.models import Sequential
      from tensorflow.keras.layers import Dense
      from tensorflow.keras.optimizers import Adam
      from tensorflow.keras.utils import to_categorical
  
      y_train = to_categorical(y_train, classes)
      y_test = to_categorical(y_test, classes)
  
      model = Sequential([
          Dense(64, input_dim=input_dim, activation='relu'),
          Dense(classes, activation='softmax')
      ])
  
      model.compile(optimizer=Adam(learning_rate=learning_rate), 
                    loss='categorical_crossentropy', 
                    metrics=['accuracy'])
  
      model.fit(x_train, y_train, epochs=training_epochs, batch_size=32, verbose=0)
  
      loss, accuracy = model.evaluate(x_test, y_test, verbose=0)
      return accuracy