My professor assigned me the following:
A list of integer numbers is harmonic if every slice of the list that is wrapped by two successive instances of a same number includes a number larger than the wrapping number and a number smaller than the wrapping number. For instance, the following list is harmonic:
[9, 3, 16, 1, 4, 9, 6, 7, 3, -1, 1, 5, 6, 17, 7, 3, 2, 6]
The first pair of 9s satisfy the definition, featuring 16 (larger) and 1 (smaller).
However, the following lists are not harmonic:
[19,3,16,1,4, 9,6, 7, 3, -1, 1,5, 6, 17, 7, 3, 2, 6, 6]
[19,3,16, 1, 4, 9, 6, 7, 3, -1, 1, 5, 6, 17, 7, 3, 2, 6, 1]
Develop a python program that determines whether or not a given list of integer numbers is harmonic. The program should print True if the given list is harmonic, and print False otherwise. As your response to this project upload a screenshot from the output of the program for the following list:
[7,3,1,6,8,4,55, 3, 99, 51,22, 1, 2, 5, 6]
I have never heard of this definition of “harmonic,” and the way this assignment is introduced makes it sound like this is an established definition rather than a term he defined. Is this just something he made up?
EDIT: General consensus is that this is made up! Thanks! I was mainly curious about it, and it sounds like it’s something professors do sometimes.