Ad
  • Custom User Avatar

    Took me 2 evenings to solve this one and was really hard to get my head around. Suggest searching the web for "python function closure" as your next port of call.

  • Custom User Avatar

    I'm struggling with the format of the output too, even though I get the output values correct. I created two lists of the positions and the peaks, then combined them into a dictionary like this {'pos':positions, 'peaks':peaks}. I also tried iterating through both lists to create a value:pair of each pos:peak, so output was {3:7, 6:3}.