Chapter 8 ยท Part I: Basics

Functions

Book: Ch. 8, 'Functions', pp. 129โ€“156

Pages this chapter covers

Section titles and printed pages from the 3rd edition. Notes below use the full citation.

  • Defining a Functionp. 130
    • Passing Information to a Functionp. 130
    • Arguments and Parametersp. 131
  • Passing Argumentsp. 131
    • Positional Argumentsp. 132
    • Keyword Argumentsp. 133
    • Default Valuesp. 134
    • Equivalent Function Callsp. 135
    • Avoiding Argument Errorsp. 136
  • Return Valuesp. 137
    • Returning a Simple Valuep. 137
    • Making an Argument Optionalp. 138
    • Returning a Dictionaryp. 139
    • Using a Function with a while Loopp. 140
  • Passing a Listp. 142
    • Modifying a List in a Functionp. 143
    • Preventing a Function from Modifying a Listp. 145
  • Passing an Arbitrary Number of Argumentsp. 146
    • Mixing Positional and Arbitrary Argumentsp. 147
    • Using Arbitrary Keyword Argumentsp. 148
  • Storing Your Functions in Modulesp. 149
    • Importing an Entire Modulep. 150
    • Importing Specific Functionsp. 151
    • Using as to Give a Function an Aliasp. 151
    • Using as to Give a Module an Aliasp. 152
    • Importing All Functions in a Modulep. 152
  • Styling Functionsp. 153
  • Summaryp. 154

Notes

Notes are not written yet

The section list above is only a map of the book, with printed page numbers, so you can read the chapter and come back. Original notes for this chapter are still to come.