Search Ebook here:


Starting Out with Python [Global Edition] 5th Edition



Starting Out with Python [Global Edition] 5th Edition PDF

Author: Tony Gaddis

Publisher: Pearson

Genres:

Publish Date: June 29, 2021

ISBN-10: 1292408634

Pages: 895

File Type: PDF

Language: English

read download

Book Preface

Welcome to Starting Out with Python, Fifth Edition. This book uses the Python language to teach programming concepts and problem-solving skills, without assuming any previous programming experience. With easy-to-understand examples, pseudocode, flowcharts, and other tools, the student learns how to design the logic of programs then implement those programs using Python. This book is ideal for an introductory programming course or a programming logic and design course using Python as the language.

As with all the books in the Starting Out With series, the hallmark of this text is its clear, friendly, and easy-to-understand writing. In addition, it is rich in example programs that are concise and practical. The programs in this book include short examples that highlight specific programming topics, as well as more involved examples that focus on problem solv-ing. Each chapter provides one or more case studies that provide step-by-step analysis of a specific problem and shows the student how to solve it.

Control Structures First, Then Classes

Python is a fully object-oriented programming language, but students do not have to under-stand object-oriented concepts to start programming in Python. This text first introduces the student to the fundamentals of data storage, input and output, control structures, functions, sequences and lists, file I/O, and objects that are created from standard library classes. Then the student learns to write classes, explores the topics of inheritance and polymorphism, and learns to write recursive functions. Finally, the student learns to develop simple event-driven GUI applications.

Changes in the Fifth Edition

This book’s clear writing style remains the same as in the previous edition. However, many additions and improvements have been made, which are summarized here:

● Database Programming – This edition adds a new chapter on database programming. Chapter 14 introduces the student to SQL and Python database programming with SQLite.
● Comprehension Expressions – This edition introduces and explains list comprehen-sions, dictionary comprehensions, and set comprehensions.

● Updated String Topics – Several new string topics have been added. For example:
o Throughout the text, this edition uses f-strings, which were introduced in Python 3.6, to display formatted output. F-strings use a concise and intuitive syntax and are easier to learn than the format function. The previous material on the format function has been moved to Appendix F.
o A new discussion of string tokens has been added to Chapter 8.
o A new example of reading and parsing CSV files has been added to Chapter 8.
o The discussion of string concatenation in Chapter 2 has been expanded to include implicit concatenation of adjacent strings.
● GUI Programming – Several new GUI programming topics have been added to Chapter 13, including:
o adding borders to widgets
o internal and external padding
o listbox widgets and scrollbars
● Turtle Graphics – Two commands for reading user input with dialog boxes have been introduced:
o turtle.numinput
o turtle.textinput
● Random List Element Selection – The random.choice() function is introduced in Chapter 7 as a way to randomly select list elements.
● New Function Topics – Several new topics have been added to Chapter 5. For example:
o The pass keyword is introduced.
o Expanded discussion of the value None, and why a function might return None.
o This edition adopts the standard practice of conditionally executing the main function.

Brief Overview of Each Chapter

Chapter 1: Introduction to Computers and Programming
This chapter begins by giving a very concrete and easy-to-understand explanation of how computers work, how data is stored and manipulated, and why we write programs in high-level languages. An introduction to Python, interactive mode, script mode, and the IDLE environment are also given.

Chapter 2: Input, Processing, and Output

This chapter introduces the program development cycle, variables, data types, and simple programs that are written as sequence structures. The student learns to write simple programs that read input from the keyboard, perform mathematical operations, and produce formatted screen output. Pseudocode and flowcharts are also introduced as tools for designing programs. The chapter also includes an optional introduction to the turtle graphics library.

Chapter 3: Decision Structures and Boolean Logic

In this chapter, the student learns about relational operators and Boolean expressions and is shown how to control the flow of a program with decision structures. The if, if-else, and if-elif-else statements are covered. Nested decision structures and logical operators are discussed as well. The chapter also includes an optional turtle graphics section, with a discus-sion of how to use decision structures to test the state of the turtle.

Chapter 4: Repetition Structures

This chapter shows the student how to create repetition structures using the while loop and for loop. Counters, accumulators, running totals, and sentinels are discussed, as well as techniques for writing input validation loops. The chapter also includes an optional section on using loops to draw designs with the turtle graphics library.

Chapter 5: Functions

In this chapter, the student first learns how to write and call void functions. The chapter shows the benefits of using functions to modularize programs and discusses the top-down design approach. Then, the student learns to pass arguments to functions. Common library functions, such as those for generating random numbers, are discussed. After learning how to call library functions and use their return value, the student learns to define and call his or her own functions. Then the student learns how to use modules to organize functions. An optional section includes a discussion of modularizing turtle graphics code with functions.

Chapter 6: Files and Exceptions

This chapter introduces sequential file input and output. The student learns to read and write large sets of data and store data as fields and records. The chapter concludes by discussing exceptions and shows the student how to write exception-handling code.

Chapter 7: Lists and Tuples

This chapter introduces the student to the concept of a sequence in Python and explores the use of two common Python sequences: lists and tuples. The student learns to use lists for arraylike operations, such as storing objects in a list, iterating over a list, searching for items in a list, and calculating the sum and average of items in a list. The chapter discusses list comprehension expressions, slicing, and many of the list methods. One- and two-dimensional lists are covered. The chapter also includes a discussion of the matplotlib package, and how to use it to plot charts and graphs from lists.

Chapter 8: More About Strings

In this chapter, the student learns to process strings at a detailed level. String slicing and algorithms that step through the individual characters in a string are discussed, and several built-in functions and string methods for character and text processing are introduced. This chapter also includes examples of string tokenizing and parsing CSV files.

Chapter 9: Dictionaries and Sets

This chapter introduces the dictionary and set data structures. The student learns to store data as key-value pairs in dictionaries, search for values, change existing values, add new key-value pairs, delete key-value pairs, and write dictionary comprehensions. The student learns to store values as unique elements in sets and perform common set operations such as union, intersection, difference, and symmetric difference. Set comprehensions are also introduced. The chapter concludes with a discussion of object serialization and introduces the student to the Python pickle module.

Chapter 10: Classes and Object-Oriented Programming

This chapter compares procedural and object-oriented programming practices. It covers the fundamental concepts of classes and objects. Attributes, methods, encapsulation and data hiding, _ _init_ _ functions (which are similar to constructors), accessors, and mutators are discussed. The student learns how to model classes with UML and how to find the classes in a particular problem.

Chapter 11: Inheritance

The study of classes continues in this chapter with the subjects of inheritance and polymor-phism. The topics covered include superclasses, subclasses, how _ _init_ _ functions work in inheritance, method overriding, and polymorphism.

Chapter 12: Recursion

This chapter discusses recursion and its use in problem solving. A visual trace of recursive calls is provided, and recursive applications are discussed. Recursive algorithms for many tasks are presented, such as finding factorials, finding a greatest common denominator (GCD), and sum-ming a range of values in a list, and the classic Towers of Hanoi example are presented.

Chapter 13: GUI Programming

This chapter discusses the basic aspects of designing a GUI application using the tkinter module in Python. Fundamental widgets, such as labels, buttons, entry fields, radio buttons, check buttons, list boxes, and dialog boxes, are covered. The student also learns how events work in a GUI application and how to write callback functions to handle events. The chapter includes a discussion of the Canvas widget, and how to use it to draw lines, rectangles, ovals, arcs, polygons, and text.

Chapter 14: Database Programming

This chapter introduces the student to database programming. The chapter first introduces the basic concepts of databases, such as tables, rows, and primary keys. Then the student learns to use SQLite to connect to a database in Python. SQL is introduced and the student learns to execute queries and statements that search for rows, add new rows, update existing rows, and delete rows. CRUD applications are demonstrated, and the chapter concludes with a discussion of relational data.

Appendix A: Installing Python
This appendix explains how to download and install the latest Python distribution.

Appendix B: Introduction to IDLE
This appendix gives an overview of the IDLE integrated development environment that comes with Python.
Appendix C: The ASCII Character Set
As a reference, this appendix lists the ASCII character set.
Appendix D: Predefined Named Colors
This appendix lists the predefined color names that can be used with the turtle graphics library, matplotlib and tkinter.
Appendix E: More About the import Statement
This appendix discusses various ways to use the import statement. For example, you can use the import statement to import a module, a class, a function, or to assign an alias to a module.
Appendix F: Formatting Numeric Output with the format() Function
This appendix discusses the format() function and shows how to use its format specifiers to control the way that numeric values are displayed.
Appendix G: Installing Modules with the pip Utility
This appendix discusses how to use the pip utility to install third-party modules from the Python Package Index, or PyPI.
Appendix H: Answers to Checkpoints
This appendix gives the answers to the Checkpoint questions that appear throughout the text.

Organization of the Text
The text teaches programming in a step-by-step manner. Each chapter covers a major set of topics and builds knowledge as students progress through the book. Although the chapters can be easily taught in their existing sequence, you do have some flexibility in the order that you wish to cover them. Figure P-1 shows chapter dependencies. Each box represents a chapter or a group of chapters. An arrow points from a chapter to the chapter that must be covered before it.


Download Ebook Read Now File Type Upload Date
Download here Read Now PDF January 18, 2022

How to Read and Open File Type for PC ?