Ad
  • Default User Avatar

    The only thing that makes it a "challenge" is knowing the formula. A brand new coder can solve this barely knowing a language if they heard the formula once.

  • Default User Avatar
  • Default User Avatar

    You are trying to write to a variable outside the scope of your function with p0 += something.
    (It's bad practice to use functions to edit variables outside of your function to begin with most of the time)

    By declaring pop you have a variable you can write to and do what you want with inside your function.