advancing_example.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. def advancing_progression_original():
  2. """
  3. Here is a progression of three-note chords that begins with notes [1, 2, 3]
  4. and ends with notes [4, 5, 6]
  5. The output of this function is the following:
  6. [(1, 2, 3), (1, 2, 4), (1, 3, 4), (2, 3, 4), (1, 2, 5), (1, 3, 5),
  7. (2, 3, 5), (1, 4, 5), (2, 4, 5), (3, 4, 5), (1, 2, 6), (1, 3, 6),
  8. (2, 3, 6), (1, 4, 6), (2, 4, 6), (3, 4, 6), (1, 5, 6), (2, 5, 6),
  9. (3, 5, 6), (4, 5, 6)]
  10. """
  11. print([(a, b, c)
  12. for c in range(3, 7)
  13. for b in range(2, c)
  14. for a in range(1, b)])
  15. def advancing_progression_one():
  16. """
  17. The output of this function is the following:
  18. [(1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 2, 6)]
  19. """
  20. print([(1, 2, c)
  21. for c in range(3, 7)])
  22. def advancing_progression_two():
  23. """
  24. The output of this function is the following:
  25. [(1, 2, 3), (1, 2, 4), (1, 3, 4), (1, 2, 5), (1, 3, 5), (1, 4, 5),
  26. (1, 2, 6), (1, 3, 6), (1, 4, 6), (1, 5, 6)]
  27. """
  28. print([(1, b, c)
  29. for c in range(3, 7)
  30. for b in range(2, c)])
  31. print("FIRST LEVEL")
  32. advancing_progression_one()
  33. print("SECOND LEVEL")
  34. advancing_progression_two()
  35. print("THIRD LEVEL")
  36. advancing_progression_original()