Introduction to Python Programming provides a comprehensive foundation in programming concepts and skills, and it is aligned to the scope of most introductory courses. A wide array of scenarios, contexts, and problems reflect programming applications in many disciplines and careers. The offering is suitable for a diverse learner audience, including those pursuing computer science, business, science, social science, statistics, data science, and related areas of study and employment.
Introduction to Python Programming is an interactive offering that teaches basic programming concepts, problem-solving skills, and the Python language using hands-on activities. The resource includes a unique, integrated code runner through which students can immediately apply what they learn to check their understanding. Embedded videos, critical thinking exercises, and explorations of external programming tools and activities all contribute to a meaningful and supportive learning experience.
Conditions of Use
This book is licensed under a Creative Commons License (CC BY-NC-SA). You can download the ebook Introduction to Python Programming for free.
- Title
- Introduction to Python Programming
- Publisher
- OpenStax
- Author(s)
- Aubrey Lawson, Chris Mayfield, Narges Norouzi, Reed Kanemaru, Udayan Das, Yamuna Rajasekhar
- Published
- 2024-03-13
- Edition
- 1
- Format
- eBook (pdf, epub, mobi)
- Pages
- 414
- Language
- English
- ISBN-13
- 9781961584457
- License
- CC BY-NC-SA
- Book Homepage
- Free eBook, Errata, Code, Solutions, etc.
Preface Chapter 1 Statements Introduction 1.1 Background 1.2 Input/output 1.3 Variables 1.4 String basics 1.5 Number basics 1.6 Error messages 1.7 Comments 1.8 Why Python? 1.9 Chapter summary Chapter 2 Expressions Introduction 2.1 The Python shell 2.2 Type conversion 2.3 Mixed data types 2.4 Floating-point errors 2.5 Dividing integers 2.6 The math module 2.7 Formatting code 2.8 Python careers 2.9 Chapter summary Chapter 3 Objects Introduction 3.1 Strings revisited 3.2 Formatted strings 3.3 Variables revisited 3.4 List basics 3.5 Tuple basics 3.6 Chapter summary Chapter 4 Decisions Introduction 4.1 Boolean values 4.2 If-else statements 4.3 Boolean operations 4.4 Operator precedence 4.5 Chained decisions 4.6 Nested decisions 4.7 Conditional expressions 4.8 Chapter summary Chapter 5 Loops Introduction 5.1 While loop 5.2 For loop 5.3 Nested loops 5.4 Break and continue 5.5 Loop else 5.6 Chapter summary Chapter 6 Functions Introduction 6.1 Defining functions 6.2 Control flow 6.3 Variable scope 6.4 Parameters 6.5 Return values 6.6 Keyword arguments 6.7 Chapter summary Chapter 7 Modules Introduction 7.1 Module basics 7.2 Importing names 7.3 Top-level code 7.4 The help function 7.5 Finding modules 7.6 Chapter summary Chapter 8 Strings Introduction 8.1 String operations 8.2 String slicing 8.3 Searching/testing strings 8.4 String formatting 8.5 Splitting/joining strings 8.6 Chapter summary Chapter 9 Lists Introduction 9.1 Modifying and iterating lists 9.2 Sorting and reversing lists 9.3 Common list operations 9.4 Nested lists 9.5 List comprehensions 9.6 Chapter summary Chapter 10 Dictionaries Introduction 10.1 Dictionary basics 10.2 Dictionary creation 10.3 Dictionary operations 10.4 Conditionals and looping in dictionaries 10.5 Nested dictionaries and dictionary comprehension 10.6 Chapter summary Chapter 11 Classes Introduction 11.1 Object-oriented programming basics 11.2 Classes and instances 11.3 Instance methods 11.4 Overloading operators 11.5 Using modules with classes 11.6 Chapter summary Chapter 12 Recursion Introduction 12.1 Recursion basics 12.2 Simple math recursion 12.3 Recursion with strings and lists 12.4 More math recursion 12.5 Using recursion to solve problems 12.6 Chapter summary Chapter 13 Inheritance Introduction 13.1 Inheritance basics 13.2 Attribute access 13.3 Methods 13.4 Hierarchical inheritance 13.5 Multiple inheritance and mixin classes 13.6 Chapter summary Chapter 14 Files Introduction 14.1 Reading from files 14.2 Writing to files 14.3 Files in different locations and working with CSV files 14.4 Handling exceptions 14.5 Raising exceptions 14.6 Chapter summary Chapter 15 Data Science Introduction 15.1 Introduction to data science 15.2 NumPy 15.3 Pandas 15.4 Exploratory data analysis 15.5 Data visualization 15.6 Summary Answer Key Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Index