Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium
      Intuition
      4 of 102

      Average growth

      Money grows by a different factor each year: 1.5 means +50%, 0.5 means −50%. Write average_growth(factors): one yearly factor that stands for all the years.

      $100 grew 50% one year and shrank 50% the next. Your function gets each year’s growth factor and hands back one factor for a typical year.

      $100 over two yearsthe real years$100starta typical year, every year$100start

      type a factor to try a typical year

      Your functionaverage_growth(factors)
      factorsone per year, e.g. [1.5, 0.5] is +50% then -50%e.g. [1.1, 1.1, 1.1]
      returnsone yearly factor that stands for all the years
      solution.pyLoading Python
      Sign in for an AI hint
      ← Grade calculatorAverage speed →