def accuracy(y_predictions, y_true):
    """
    Calculate the accuracy.

    Input
        y_predictions: a one-dimensional numpy array of predicted classes (0s and 1s).
        y_true: a one-dimensional numpy array of true classes (0s and 1s).

    Output
        acc: accuracy, a float between 0 and 1 
    """
    t, c = len(y_predictions), 0
    for i in range(t):
        if (y_predictions[i] == y_true[i]):
            c = c + 1
    acc = c / t
    return acc