Have students who are transitioning from Python to Java explore the “From Python to Java” website to show them the differences between the two languages.
Use Python as an introductory language rather than Java or C to allow students to focus on problem-solving more than syntax.
Help students build intuition about recursion in Python by comparing each recursive call to a function call, which may be more intuitive for students in introductory classes.
Misconception: Return is a mystery to students because they may not understand that functions have an entry point and an exit point. This results in mistakes such as assuming Python will return the right thing.
Forward students links to programs in Python Tutor and ask them to answer questions about how the code works to go over what happens during a function call to provide students in-depth practice.
Get students paying attention to types in Python; although type declarations aren’t explicitly required in Python, they still exist and are crucial to understanding how Python manages data.
Reinforce that certain types in Python such as lists are mutable while others (e.g. strings, tuples) are not. Students have difficulty tracing code that uses mutable types because they often forget this.
Spend extra time teaching Big O in intro classes that use Python because the underlying implementation of Python lists is a mystery to students that leads students to believe many operations are constant, O(1), that are not.
Draw attention to types when teaching students Python to help lay the groundwork for understanding types in lower-level programming languages they’ll learn about later.