prize17-8, Exercise 2: E Dorian and G Dorian notes = ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"] steps = [2, 1, 2, 2, 2, 1, 2] def dorian(root): i = notes.index(root) scale = [root] for s in steps[:-1]: i = (i + s) % 12 scale.append(notes[i]) return scale print("E Dorian :", dorian("E")) print("G Dorian :", dorian("G")) Output (run and checked): E Dorian : ['E', 'Gb', 'G', 'A', 'B', 'Db', 'D'] G Dorian : ['G', 'A', 'Bb', 'C', 'D', 'E', 'F'] What you notice: the program only has flat names, so F-sharp appears as Gb and C-sharp as Db. In standard notation E Dorian is written E, F-sharp, G, A, B, C-sharp, D, and the notes are the same pitches under different names. Care: a program that spells every black key as a flat gives correct pitches but not always correct spelling.