ModernPythonCookbook - (EPUB全文下载)
文件大小:1.25 mb。
文件格式:epub 格式。
书籍内容:
Modern Python Cookbook
Table of Contents
Modern Python Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Numbers, Strings, and Tuples
Introduction
Creating meaningful names and using variables
Getting ready
How to do it...
Choosing names wisely
Assigning names to objects
How it works...
There's more...
See also
Working with large and small integers
Getting ready
How to do it...
How it works...
There's more...
See also
Choosing between float, decimal, and fraction
Getting ready
How to do it...
Doing currency calculations
Fraction calculations
Floating-point approximations
Converting numbers from one type to another
How it works...
There's more...
See also
Choosing between true division and floor division
Getting ready
How to do it...
Doing floor division
Doing true division
Rational fraction calculations
How it works...
See also
Rewriting an immutable string
Getting ready
How to do it...
Slicing a piece of a string
Updating a string with a replacement
Making a string all lowercase
Removing extra punctuation marks
How it works...
There's more...
See also
String parsing with regular expressions
Getting ready
How to do it...
How it works...
There's more...
See also
Building complex strings with "template".format()
Getting ready
How to do it...
How it works...
There's more...
See also
Building complex strings from lists of characters
Getting ready
How to do it...
How it works...
There's more
See also
Using the Unicode characters that aren't on our keyboards
Getting ready
How to do it...
How it works...
See also
Encoding strings – creating ASCII and UTF-8 bytes
Getting ready
How to do it...
How it works...
See also
Decoding bytes – how to get proper characters from some bytes
Getting ready
How to do it..
How it works...
See also
Using tuples of items
Getting ready
How to do it...
Creating tuples
Extracting items from a tuple
How it works...
There's more
See also...
2. Statements and Syntax
Introduction
Writing Python script and module files – syntax basics
Getting ready
How to do it...
How it works...
There's more...
See also
Writing long lines of code
Getting ready
How to do it...
Using backslash to break a long statement into logical lines
Using the () characters to break a long statement into sensible pieces
Using string literal concatenation
Assi ............
书籍插图:
以上为书籍内容预览,如需阅读全文内容请下载EPUB源文件,祝您阅读愉快。
书云 Open E-Library » ModernPythonCookbook - (EPUB全文下载)