Preface
Introduction to Python Programming was originally authored by Udayan Das, Aubrey Lawson, Chris Mayfield, and Narges Norouzi, and published by OpenStax, Rice University. It is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). The original work is available at openstax.org. This version has been adapted for use in the Universal Open Textbook Initiative.
About Introduction to Python Programming
Introduction to Python Programming provides a comprehensive foundation in programming concepts and skills, and 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.
The content is organized in chapters, with each chapter containing 6-8 sections. Each section follows the pattern:
- Learning objectives
- 1–3 subsections
- Programming practice
The learning objectives are designed to help readers identify the section's focus. Each objective completes the sentence, "By the end of this section you should be able to". The programming practice aligns with the learning objectives and gives readers an opportunity to apply concepts learned in the section.
Pedagogical Foundation
Concise text and video-based animations
Introduction to Python Programming is designed to foster active learning and student engagement. It focuses on interactivity and practice through its integrated code runner, videos, and links to external environments and activities. With that focus, the material is often more concise, with less text and more activity.
Each section's content is organized in subsections. The subsection begins with a concise introduction to the concept, with key term definitions and brief context for its relevance and importance. The concept is then explained in detail using video-based animations and interactive learning questions.
Animation videos use a step-by-step approach to show the execution of Python code. Explanations for each step describe Python syntax, show how fundamental programming concepts are used, illustrate how variables are assigned, emphasize how code executes line by line, apply problem solving to create programs, and more.
Learning questions
After introducing a new concept and explaining the concept with a video-based animation, each subsection includes engagement in the form of learning questions. These questions reinforce the concepts taught, explain concepts in more depth, directly address misconceptions and errors commonly made by new programmers, and teach related concepts.
Explanations are provided for the incorrect answers. Incorrect answers' explanations include why the answer is incorrect and help guide the reader to the correct answer.
Incorrect answer choices typically represent a misconception or are the result of making a common mistake. Even if the correct answer is achieved, readers are encouraged to explore the explanations to gain awareness of these common misconceptions.
Programming practice exercises
Each section ends with 1 or 2 practice programs. This book includes an integrated programming environment, known as the "OpenStax Python Code Runner," which allows readers to write programs directly in the browser. The code runner requires the reader to pre-enter any input before running a program.
Conventions used in this book
The following typographical conventions are used throughout the book:
Bold
Indicates vocabulary words when first defined in the chapter.
Italic
Indicates emphasized text, filenames, and file extensions.
Constant width
Used for code listings and code elements within paragraphs. Code elements include variable names, Python keywords, etc.
Constant width bold
Shows commands or keyboard input that should be typed literally by the user.
Ex:
Abbreviation for "Example:"
About the Authors
Senior Contributing Authors
Udayan Das, Saint Mary's College of California
Udayan Das, PhD, is an Associate Professor and Program Director of Computer Science at Saint Mary's College of California. He received his PhD in Computer Science and a master's in Computer Engineering from the Illinois Institute of Technology. His research interests include wireless networks, computer science education and broadening participation in computing, and knowledge graph backed language models for technical document processing.
Aubrey Lawson, Wiley
Aubrey Lawson is a CS Content Developer at zyBooks. She received her bachelor's and master's degrees in Computer Science from Clemson University, and her PhD research focuses on CS education.
Chris Mayfield, James Madison University
Chris Mayfield, PhD, is a Professor of Computer Science at James Madison University. His research focuses on CS education and professional development at the undergraduate and high school levels. He received a PhD in Computer Science from Purdue University and bachelor's degrees in CS and German from the University of Utah.
Narges Norouzi, UC Berkeley
Narges Norouzi received her MS and PhD from the University of Toronto, focusing on applied deep learning. She has since been involved in working on applied machine learning projects with a focus on biology and education. Her CS education research focuses on using artificial intelligence in the classroom to close the equity gap and leading student-centered programs that promote equity and access.
Contributing Authors
Yamuna Rajasekhar, Wiley
Yamuna Rajasekhar, PhD, is Director of Content, Authoring, and Research at Wiley. She works across disciplines on research strategy, authoring pedagogy and training, and content development for Computer Science and IT.
Reed Kanemaru, Wiley
Reed Kanemaru earned a BS in Computer Science from University of California, Riverside in 2020 and an MS in Computer Science from University of California, Riverside in 2021. Since graduating, he has worked as a Content/Software Developer at zyBooks.
Reviewers
Mel Akhimiemona, Community College of Baltimore County
Doina Bein, Cal State Fullerton
Phillip Bradford, University of Connecticut
James Braman, Community College of Baltimore County
Robert Burrows, College of DuPage
Deena Engel, New York University
Gabriel Ferrer, Hendrix College
Nazli Hardy, Millersville University
Matthew Hertz, University at Buffalo
Rania Hodhod, Columbus State University
Akira Kawaguchi, The City College of New York
Kevin Lin, University of Washington
Matin Pirouz, Fresno State
Muhammad Rahman, Clayton State University
Jerry Reed, Valencia College
Kathleen Tamerlano, Cuyahoga Community College
Linda Tansil
Additional Resources
Instructors can find and share community-created teaching materials at oercommons.org/hubs/OpenStax.