Python Programming delineates the fundamentals of Python language and provides an insight to Python’s role in domains such as the Web, GUI and databases. It focuses on the object oriented programming nature of Python and shows how Python language can be used to develop clean and efficient programs. Designed as a self-learning kit for undergraduate students of computer science, the book has a rich pedagogy that includes fill-in-the-blanks, true/false, MCQs, short- and long-answer type questions, and debugging exercises to hone the learner’s skills in Python programming.
Ch Satyanarayana is Professor, Department of CSE, and Director of Academics and Planning, JNTU Kakinada
M Radhika Mani is Head of the Department of Computer Science and Engineering, Pragati Engineering College, Surampalem, Andhra Pradesh
B N Jagadesh is Head of the Department of Computer Science and Engineering, Srinivasa Institute of Engineering and Technology, Amalapuram, Andhra Pradesh
Preface
Introduction 1.1 Introduction to Computer Systems Generations of computers | Applications of computers | Classification of computers 1.2 Computer Hardware Input/ Output devices | CPU | Memory 1.3 Computer Software System software | Application software 1.4 Programming Languages Machine-level programming language | Assembly-level programming language | High-level programming language 1.5 Algorithmic Problem Solving Algorithms | Characteristics of algorithm | Advantages and disadvantages of algorithm | Algorithm notation | Building blocks of algorithms | Steps for developing algorithms | Simple strategies for developing algorithms | Find minimum in a list | Insert a card in a list of sorted cards | Guess an integer number in a range | Towers of Hanoi algorithm 1.6 Building Blocks of Program 1.7 Background of Learning to Write Programs 1.8 Sample Algorithms Glossary | Summary | Multiple Choice Questions | Fill in the Blanks |State True/False |Find the Output | Find the Error | Long Answer Questions |Short Answer Questions |Exercise Algorithms | Answers
2. Fundamentals of Python Programming2.1 Introduction to Python2.2 Features of Python2.3 Applications of PythonWeb and internet development | Scientific and numeric | Education | Desktop GUIs | Software development2.4 Installation of PythonWindows operating system | Linux operating system2.5 Sample Program2.6 Python Virtual Machine2.7 Frozen Binaries2.8 Memory Management in Python2.9 Comparison Between C and Python2.10 Comparison Between Java and Python2.11 Python vs Similar Tools2.12 Python Keywords2.13 Python Identifiers2.14 Python Statements2.15 Python Indentation2.16 Comments in Python2.17 Differences Between Python 2.x and 3.x2.18 Coding Styles in PythonGlossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Long Answer Questions | Short Answer Questions | Answers
3. Syntax and Styles3.1 Data Types3.2 Literal3.3 Numeric Literal3.4 Boolean Literal3.5 String Literal3.6 Variable3.7 Operators and ExpressionsArithmetic operators | Comparison (relational) operators | Assignment operators | Logical operators| Bitwise operators | Membership operators | Identity operators3.8 Expressions and Order of Evaluations3.9 NumbersIntegers | Floating point numbers | Complex numbers3.10 Functions Applicable to All Types of Numbers3.11 Sample ProgramsGlossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions| Short Answer Questions | Exercise Programs | Answers
4. Control Flow4.1 If Statement4.2 While Statement4.3 For Statement4.4 Break Statement4.5 Continue Statement4.6 Pass Statement4.7 Entry Controlled Loop4.8 Exit Controlled Loop4.9 Counter Controlled Loop4.10 Condition Controlled Loop 4.11 Nested Loops4.12 Sample Programs4.13 Case StudiesSimple temperature converter | Simple number system converter | Generation of vowel alphabet patternGlossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output |Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers
5. Sequences–Lists5.1 Arrays5.2 Sequences5.3 Using Lists5.4 List Assignment and Equivalence5.5 List Bounds5.6 List Slicing5.7 List Cloning5.8 Nested Lists5.9 List Comprehensions5.10 Lists and Functions5.11 Prime Generation with a List5.12 Adding List Elements5.13 Mutability5.14 List Unpacking5.15 Stack5.16 Queue5.17 Functional Programming5.18 Sample ProgramsGlossary | Summary | Multiple Choice Questions | Fill in the Blanks |State True/False | Find the Output |Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers 6. Tuples6.1 Need of Tuple6.2 Sequence Unpacking6.3 Methods6.4 Sample ProgramsGlossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers 7. Dictionaries7.1 Making a Dictionary7.2 Basic Operations7.3 Dictionary Operations7.4 Sets7.5 Iterators and Generators7.6 Sample ProgramsGlossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs| Answers 8. Functions8.1 Introduction8.2 Defining Functions8.3 Calling Functions8.4 Passing Arguments8.5 Keyword Arguments8.6 Default Arguments8.7 Required Arguments8.8 Variable-length Arguments8.9 Return Statement8.10 Nesting of Passing Arguments8.11 Anonymous Functions8.12 Recursive Function8.13 Scope of Local and Global Variable8.14 Documentation Strings8.15 Sample Programs8.16 Case StudiesRecursive binary search | Substitution Cipher| Glossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs| Answers
9. Modules9.1 Introduction9.2 Importing ModulesImporting all elements of a module | Importing the specific elements of a module9.3 Creating Modules9.4 Use of name9.5 Name SpacingScope9.6 Reloading Module9.7 Sample ProgramsGlossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers10. Object Oriented Programming Principles10.1 Class Statement10.2 Class Body10.3 Objects10.4 Class Methods10.5 Self Variable10.6 Class Properties and Instance Properties10.7 Static Method10.8 Data Hiding10.9 Deleting an Object10.10 Constructor10.11 Method Overriding10.12 Inheritance10.13 Composition or Containership or Complex Object10.14 Abstract Classes and Interfaces10.15 Metaclass10.16 Operator OverloadingReverse adding | getitem() and setitem() | Membership operators | Miscellaneous functions10.17 Garbage Collection10.18 Sample Programs Glossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs| Answers11. Packages11.1 Introduction to PIP11.2 Installing Packages via PIP11.3 Using Python Packages11.4 Absolute and Relative Imports11.5 Namespace Package11.6 Sample ProgramsGlossary |Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers12. Strings and Regular Expressions12.1 Methods of String Objects Escape sequencing12.2 Iterating Strings12.3 String Module12.4 String Formatting12.5 Regular Expression Re-module12.6 Dictionary-based Formatting Expressions12.7 Sample Programs Glossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers13. Files and Directory Access13.1 Files and Streams13.2 Opening a FileThe read mode | The write mode | The append mode13.3 Reading/Writing Operations on a FileThe read operation | The write operation13.4 Other File Operations13.5 Iterating through Files13.6 Splitting Words13.7 Serialization and De-serialization13.8 Hash Files13.9 Directory Access13.10 Sample Programs Glossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers14. Errors and Exceptions14.1 Motivation14.2 Examples of Exception14.3 Handling Exceptions14.4 Try Keyword14.5 Finally Keyword14.6 Handling Exception in Invoked Functions14.7 With and Except Statements14.8 Raising Exceptions14.9 Re-raising Exception14.10 Instantiating Exception14.11 Custom Exceptions14.12 Assert Statement14.13 Pre-defined Clean-up Actions14.14 Sample Programs Glossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs| Answers
15. Multithreading15.1 Introduction to Thread15.2 Differences Between Process and Thread15.3 Threading Module15.4 Thread Synchronization15.5 Sample Program Glossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers
16. Tkinter16.1 Introduction16.2 Widget16.3 Label Widget16.4 Button Widget16.5 Checkbutton Widget16.6 Entry Widget16.7 Listbox Widget16.8 Radiobutton Widget16.9 Scrollbar Widget16.10 Text Widget16.11 Container Widgets16.12 Frame Widget16.13 Menu Widget16.14 Labelframe Widget16.15 Message Widget16.16 Combobox Widget16.17 Scale Widget16.18 Canvas Widget16.19 Sample Programs Glossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers
17. Events17.1 Event Object17.2 Binding Callbacks to Events17.3 Events Names17.4 Keyboard Events17.5 Mouse Events17.6 Sample Programs Glossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers
18. Standard Library18.1 Operating System Interface18.2 Text Processing18.3 Mathematics18.4 Internet Access18.5 Dates and Times18.6 Data Compression18.7 Turtle Graphics18.9 Sample Programs Glossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers
19. Testing19.1 Basic Concepts of Testing19.2 Unit Testing in Python19.3 Grouping Test Cases in Unit Testing19.4 Loading and Running Tests19.5 Sample ProgramsGlossary | Summary | Multiple Choice Questions | Fill in the Blanks | State True/False | Find the Output | Find the Error | Long Answer Questions | Short Answer Questions | Exercise Programs | Answers
Appendix A: NetworkingAppendix B: Sending E-mailAppendix C: Plotting GraphsAppendix D: CGI/Web Programming using Python Index
https://www.universitiespress.com/chsatyanarayana/pythonprogramming?isbn=9789386235633