Teach Your Kids To Code: A Parent-friendly Guide to Python Programming

(vip2019) #1

7


Functions: there’s a name for that


We’ve made use of a number of functions so far—


everything from print() to input() to turtle.forward().


But all of these functions have been either built-in or


imported from Python modules and libraries. In this


chapter, we’ll write our own functions to do anything


we want, including responding to user actions like


mouse-clicking and keypresses.

Free download pdf