import random


def random_key(output_on=True):
    """Returns a random major or minor key.
    Minor in lower case, major in upper case."""
    keys = ['A', 'Bb', 'B', 'C', 'C#', 'D', 'Eb', 'E', 'F', 'F#', 'G', 'Ab']
    key = random.choice(keys)
    if random.choice([0, 1]):  # minor or major
        key = key.lower()

    # Inform user of new key
    if output_on:
        print("\n" + "-" * 10 + "\n")
        if key == key.lower():
            print("KEY:", key.upper(), "min")
        else:
            print("KEY:", key, "Maj")
        print("-" * 10)

    return key