[python3] Fix IP tutorial so it executes correctly on Python2 as well