Table of Contents

 Table of Contents

Introduction Preface Introduction to Python Installing Python Running Python programs Python 2 vs Python 3 The basics of working with Python Data types Operators The Ternary Operator Strings Booleans Numbers Constants Enums User Input Control statements Lists Tuples Dictionaries Sets Functions Objects Loops

1

Classes Modules The Python Standard Library The PEP8 Python style guide Debugging Variables scope Accept arguments from the command line Lambda functions Recursion Nested functions Closures Decorators Docstrings Introspection Annotations Exceptions The with statement Installing 3rd party packages using pip List comprehensions Polymorphism Operator Overloading Virtual Environments Conclusion

2

Introduction

The Python Handbook follows the 80/20 rule: learn 80% of the topic in 20% of the time. I find this approach gives a well-rounded overview. This book does not try to cover everything under the sun related to Python. It focuses on the core of the language, trying to simplify the more complex topics. I hope the contents of this book will help you achieve what you want: learn the basics of Python. This book is written by Flavio. I publish web development tutorials every day on my website . You can reach me on Twitter @flaviocopes. Enjoy!

3

Introduction to Python

Python is literally eating the programming world. It is growing in popularity and usage in ways that are pretty much unprecedented in the history of computers.

There is a huge variety of scenarios that Python excels in. Shell scripting, task automation, Web development are just some basic examples.

Python is the language of choice for data analysis and machine learning, but it can also adapt to create games and work with embedded devices.

Most importantly, it's the language of choice for introductory computer science courses in universities all around the world.

Many students learn Python as their first programming language. Many are learning it right now, many will learn it in the future. And for many of them, Python will be the only programming language they need.

Thanks to this unique position, Python is likely going to grow even more in the future.

The language is simple, expressive, and it's quite straightforward.

The ecosystem is huge. There seems to be a library for everything you can imagine.

Python is a high-level programming language suitable for beginners thanks to its intuitive syntax, its huge community and vibrant ecosystem.

4

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download