These examples of Python 3 code are displayed using pythontutor.com. To step through an example, line-by-line, click on the Forward button towards the bottom of the frame:

Greet example (from textbook, Chapter 1 and Lab 1):

Chaos example (from textbook, Chapter 1):

Note that eval() does not work well in pythonTutor, so, the code below has the eval() call replaced with float() which returns an floating point (decimal) number when given a string.

Convert example (from textbook, Chapter 2):

Note that eval() does not work well in pythonTutor, so, the code below has the eval() call replaced with int() which returns an integer (whole number) when given a string.

Running Total example

Factorial example (from textbook, Chapter 3):

Note that eval() does not work well in pythonTutor, so, the code below has the eval() call replaced with int() which returns an integer (whole number) when given a string.

Accumulating string example

Happy Birthday example (from textbook, Chapter 6):

Jam example (from Fall 2011 Final Exam):

Decisions & Functions: Fall 2013 Final Exam, #5:

Indefinite Loops: Spring 2012 Final Exam, #8: