Practice Exercises

Here are some tutorials and exercises to practice your new Python skills.

Exercises and tutorials in Python 3

  • Interactive Python: This includes some theory as well as some practical exercises.
  • HackerRank: The mother of all exercise sites. Use Python 3 or 2.
  • Python Tutorial from University of Waterloo: Follow the tutorial and run interactive code in your browser.
  • Coding Bat: This is a series of short Python exercises that are great for quick practice. Create an account & log in to track your progress and access additional exercises.

Exercises and tutorials in Python 2

These exercises and tutorials are in Python 2, but since they’re all browser-based you should be able to follow along regardless of what version of Python you use locally.

  • Codecademy: This is part of Codecademy’s Intro to Python class. Again, you can create an account to track your progress and access additional lessons.

Remember the two main differences in Python 2 and 3:

1
2
3
4
5
6
7
8
9
10
11
# Printing in Python 2
print "Hello World"
# Printing in Python 3
print("Hello World")

# Division in Python 2
5/2 # result is 2
5/2.0 # result is 2.5
# Division in Python 3
5/2 # result is 2.5
5//2 # result is 2

Comments: