Learning path

Python practice problems

Classic beginner exercises on numbers, text and lists, each followed by a challenge to solve on your own.

15 lessons · 26 challenges

Start the path →

1 Numbers and digits 6 lessons

  1. Lesson 2 challenges Sum the Digits of a Number Add every decimal digit in an integer.
  2. Lesson 2 challenges Reverse an Integer in Python Reverse the decimal digits of an integer.
  3. Lesson 2 challenges Check an Armstrong Number Check whether a number equals the sum of its powered digits.
  4. Lesson 1 challenge Check a Perfect Number Check whether proper divisors add up to the number.
  5. Lesson 2 challenges Check a Leap Year in Python Apply Gregorian leap-year rules.
  6. Lesson 3 challenges Check a Prime Number in Python Check whether a number is prime with an efficient Python example.

2 Text problems 5 lessons

  1. Lesson 2 challenges Reverse a String in Python Reverse a Python string with slicing and run the example online.
  2. Lesson 2 challenges Count Vowels in Python Count vowels in a line of text.
  3. Lesson 2 challenges Check Anagrams in Python Check whether two texts contain the same letters.
  4. Lesson 1 challenge Check Password Strength Validate several basic password requirements.
  5. Lesson 1 challenge Caesar Cipher in Python Shift lowercase letters by a fixed amount.

3 List problems 4 lessons

  1. Lesson 2 challenges Find the Second Largest Value Find the second distinct largest list value.
  2. Lesson 1 challenge Remove Duplicate List Values Remove duplicates while preserving their first-seen order.
  3. Lesson 2 challenges Flatten a Nested List Flatten a one-level nested list.
  4. Lesson 1 challenge Split a List into Chunks Divide a list into fixed-size groups.