Editor

Python loop exercises

Practice for and while loops on problems that check your answer with tests as soon as you submit.

Beginner

  1. 204. Rocket CountdownThe last seconds before a rocket leaves the launch pad25 XP3 min
  2. 207. Times TableThe multiplication table, written out line by line25 XP4 min
  3. 214. Collatz StepsA famous unsolved puzzle about numbers that always seem to fall to 130 XP5 min
  4. 520. Sum of MultiplesAdding up the threes and fives, and coming up short25 XP3 min
  5. 524. The Priciest ItemWhich thing in the shopping basket cost the most?25 XP3 min
  6. 525. Total of the Odd NumbersAdd up every odd number between two bookends25 XP3 min
  7. 526. Triangular NumbersStack bowling pins in rows: how many pins does each triangle need?25 XP4 min
  8. 539. Count the Leap YearsHow many February 29ths fall between two years?30 XP5 min
  9. 541. Did Everyone Pass?A class report that is far too optimistic30 XP4 min
  10. 542. Double FactorialA factorial that skips every other number30 XP4 min
  11. 552. Star StaircaseDraw a staircase of stars that climbs to the right30 XP5 min
  12. 554. The Biggest DigitWhich digit wins inside a long number?30 XP5 min
  13. 566. Floyd's TriangleCount upward and stack the numbers into a growing triangle35 XP6 min
  14. 567. Multiplication SquareThe whole multiplication chart from the classroom wall35 XP6 min

Intermediate

  1. 16. Sum of DigitsAdd up the digits of a number55 XP5 min
  2. 20. FactorialThe product of every number up to n65 XP6 min
  3. 21. Fibonacci SequenceThe sequence where each number adds the two before70 XP7 min
  4. 22. FizzBuzzFizz, Buzz or a number: the classic counting game75 XP8 min
  5. 23. Prime Number CheckIs this number divisible only by 1 and itself?80 XP8 min
  6. 270. Happy NumbersSome numbers find their way to 1, others wander in circles forever60 XP10 min

Other topics

Or see every challenge, with study plans, today's challenge and duels.