Python 3 - Sample Code, not Golfed
def twelve_bar_blues(k_input):
chords = ['Ab', 'A', 'Bb', 'B', 'C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G']*2
if k_input not in chords and k_input[1] == '#':
k_index = chords.index(k_input[0]) + 1
k = chords[k_index]
else:
k = k_input
I_index = chords.index(k)
I = chords[I_index]
IV_index = I_index + 5
IV = chords[IV_index]
V_index = I_index + 7
V = chords[V_index]
return f'{I} {I} {I} {I} {IV} {IV} {I} {I} {V} {IV} {I} {I}'
Try it online!