Linked e-resources
Details
Table of Contents
At a Glance; Contents; About the Author; About the Technical Reviewer; Acknowledgments; Chapter 1: Getting Started; Welcome; What Is Python?; Installing Python; IDLE and the Python Shell; Hello World; Creating, Saving, and Running a Python File; IDLE on Multiple Platforms; Summary; Chapter 2: Variables and Assignment Statements; A Sample Python Program; The Building Blocks of Programming; Four Types of Data; Integers; Floats; Strings; Booleans; Examples of Data; Form with Underlying Data; Variables; Assignment Statements; Variable Names; Naming Convention; Keywords; Case Sensitivity
More Complicated Assignment StatementsPrint Statements; Simple Math; Order of Operations; First Python Programs; Shorthand Naming Convention; Adding Comments; Full-Line Comment; Add a Comment After a Line of Code; Multiline Comment; Whitespace; Errors; Syntax Error; Exception Error; Logic Error; Summary; Chapter 3: Built-in Functions; Overview of Built-in Functions; Function Call; Arguments; Results; Built-in type Function; Getting Input from the User; Conversion Functions; int Function; float Function; str Function; First Real Programs; Concatenation; Another Programming Exercise
Using Function Calls Inside Assignment StatementsSummary; Chapter 4: User-Defined Functions; A Recipe as an Analogy for Building Software; Ingredients; Directions; Definition of a Function; Building Our First Function; Calling a User-Defined Function; Receiving Data in a User-Defined Function: Parameters; Building User-Defined Functions with Parameters; Building a Simple Function that Does Addition; Building a Function to Calculate an Average; Returning a Value from a Function: The return Statement; Returning No Value: None; Returning More Than One Value
Specific and General Variable Names in Calls and FunctionsTemperature Conversion Functions; Placement of Functions in a Python File; Never Write Multiple Copies of the Same Code; Constants; Scope; Global Variables and Local Variables with the Same Names; Finding Errors in Functions: Traceback; Summary; Chapter 5: if, else, and elif Statements; Flowcharting; The if Statement; Comparison Operators; Examples of if Statements; Nested if Statement; The else Statement; Using if/else Inside a Function; The elif Statement; Using Many elif Statements; A Grading Program
A Small Sample Program: Absolute ValueProgramming Challenges; Negative, Positive, Zero; isSquare; isEven; isRectangle; Conditional Logic; The Logical not Operator; The Logical and Operator; The Logical or Operator; Precedence of Comparison and Logical Operators; Booleans in if Statements; Program to Calculate Shipping; Summary; Chapter 6: Loops; User's View of the Game; Loops; The while Statement; First Loop in a Real Program; Increment and Decrement; Running a Program Multiple Times; Python Built-in Packages; Generating a Random Number; Simulation of Flipping a Coin
More Complicated Assignment StatementsPrint Statements; Simple Math; Order of Operations; First Python Programs; Shorthand Naming Convention; Adding Comments; Full-Line Comment; Add a Comment After a Line of Code; Multiline Comment; Whitespace; Errors; Syntax Error; Exception Error; Logic Error; Summary; Chapter 3: Built-in Functions; Overview of Built-in Functions; Function Call; Arguments; Results; Built-in type Function; Getting Input from the User; Conversion Functions; int Function; float Function; str Function; First Real Programs; Concatenation; Another Programming Exercise
Using Function Calls Inside Assignment StatementsSummary; Chapter 4: User-Defined Functions; A Recipe as an Analogy for Building Software; Ingredients; Directions; Definition of a Function; Building Our First Function; Calling a User-Defined Function; Receiving Data in a User-Defined Function: Parameters; Building User-Defined Functions with Parameters; Building a Simple Function that Does Addition; Building a Function to Calculate an Average; Returning a Value from a Function: The return Statement; Returning No Value: None; Returning More Than One Value
Specific and General Variable Names in Calls and FunctionsTemperature Conversion Functions; Placement of Functions in a Python File; Never Write Multiple Copies of the Same Code; Constants; Scope; Global Variables and Local Variables with the Same Names; Finding Errors in Functions: Traceback; Summary; Chapter 5: if, else, and elif Statements; Flowcharting; The if Statement; Comparison Operators; Examples of if Statements; Nested if Statement; The else Statement; Using if/else Inside a Function; The elif Statement; Using Many elif Statements; A Grading Program
A Small Sample Program: Absolute ValueProgramming Challenges; Negative, Positive, Zero; isSquare; isEven; isRectangle; Conditional Logic; The Logical not Operator; The Logical and Operator; The Logical or Operator; Precedence of Comparison and Logical Operators; Booleans in if Statements; Program to Calculate Shipping; Summary; Chapter 6: Loops; User's View of the Game; Loops; The while Statement; First Loop in a Real Program; Increment and Decrement; Running a Program Multiple Times; Python Built-in Packages; Generating a Random Number; Simulation of Flipping a Coin