Book Image

Python Essentials

By : Steven F. Lott
Book Image

Python Essentials

By: Steven F. Lott

Overview of this book

Table of Contents (22 chapters)
Python Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


We've looked at some core data types available in Python. We've looked at five different kinds of numbers, including integers, floating-point, complex, Fraction and Decimal. Each fills a different niche. Three of these are built-in, the other two must be imported from the standard library.

We've also looked at three different kinds of collections. The tuple is a simple sequence of items with relatively few methods. str is a Unicode string, which has several methods for creating new strings as transformations of existing strings. bytes is a byte string, which also has a variety of methods. We can decode bytes to create Unicode strings. We can encode Unicode strings into bytes.

We've touched on how the import statement is used to introduce new types and new modules. This will add features from the standard library.

We've also looked at a number of functions to convert various numeric types. Many of these functions also convert strings to numbers. We'll make heavy use of int() and float...