Product SiteDocumentation Site

Python for you and me 0.2

Python for you and me

A book to learn Python in a quick way (work in progress)

Edition 2

Logo

Kushal Das

Linux User Group of Durgapur

Legal Notice

Copyright © 2008-2012 Kushal Das This material may only be distributed subject to the terms and conditions set forth in the GNU Free Documentation License (GFDL), V1.2 or later (the latest version is presently available at http://www.gnu.org/licenses/fdl.txt).
Abstract

This book is for the python newbies
Preface
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. We Need Feedback!
1. Installation
1.1. On Windows
1.2. On GNU/Linux
2. The Beginning
2.1. helloworld.py
2.2. Whitespaces and indentation
2.3. Comments
2.4. Modules
3. Variables and Datatypes
3.1. Keywords and Identifiers
3.2. Reading input from the Keyboard
3.3. Some Examples
3.3.1. Average of N numbers
3.3.2. Temperature conversion
3.4. Multiple assignments in a single line
4. Operators and expressions
4.1. Operators
4.2. Example of integer arithmetic
4.3. Relational Operators
4.4. Logical Operators
4.5. Shorthand Operator
4.6. Expressions
4.7. Type Conversions
4.8. evaluateequ.py
4.9. quadraticequation.py
4.10. salesmansalary.py
5. If-else , the control flow
5.1. If statement
5.2. Else statement
5.3. Truth value testing
6. Looping
6.1. While loop
6.2. Fibonacci Series
6.3. Power Series
6.4. Multiplication Table
6.5. Some printing * examples
6.6. Lists
6.7. For loop
6.8. range() function
6.9. Continue statement
6.10. Else loop
6.11. Game of sticks
7. Data Structures
7.1. Lists
7.2. Using lists as stack and queue
7.3. List Comprehensions
7.4. Tuples
7.5. Sets
7.6. Dictionaries
7.7. students.py
7.8. matrixmul.py
8. Strings
8.1. Different methods available for Strings
8.2. Strip the strings
8.3. Finding text
8.4. Palindrome checking
8.5. Number of words
9. Functions
9.1. Defining a function
9.2. Local and global variables
9.3. Default argument value
9.4. Keyword arguments
9.5. Docstrings
10. File handling
10.1. File opening
10.2. Closing a file
10.3. Reading a file
10.4. Writing in a file
10.5. copyfile.py
10.6. Random seeking in a file
10.7. Count spaces, tabs and new lines in a file
11. Class
11.1. Your first class
11.2. __init__ method
11.3. Inheritance
11.4. student_teacher.py
11.5. Multiple Inheritance
11.6. Deleting an object
12. Iterators, generators and decorators
12.1. Iterators
12.2. Generators
12.3. Generator expressions
12.4. Clousers
13. Modules
13.1. Introduction
13.2. Importing modules
13.3. Default modules
13.4. Submodules
13.5. Module os
14. Collections module
14.1. Counter
14.2. defaultdict
14.3. namedtuple
15. Virtualenv
15.1. Installation
15.2. Usage
16. Acknowledgment
A. Revision History
Index