Skip to content
LearnStack
Python curriculum

Python practice

Short exercises. Try them first, open the hint if you are stuck, and the solution last.

  1. Exercise 1

    Square numbers

    Print the squares of the numbers 1 to 5, one per line.

    Your solutionPython
  2. Exercise 2

    Grade

    Given score = 72, print A for 90 or more, B for 75 or more, C for 60 or more, otherwise F.

    Your solutionPython
  3. Exercise 3

    Count vowels

    Count the vowels in the word programming and print the number.

    Your solutionPython