Supercharged Python: Take Your Code to the Next Level

[Pages:110] Supercharged Python

This page intentionally left blank

Supercharged Python

Brian Overland John Bennett

Boston ? Columbus ? New York ? San Francisco ? Amsterdam ? Cape Town Dubai ? London ? Madrid ? Milan ? Munich ? Paris ? Montreal ? Toronto ? Delhi ? Mexico City S?o Paulo ? Sydney ? Hong Kong ? Seoul ? Singapore ? Taipei ? Tokyo

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.

The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.

For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at corpsales@ or (800) 382-3419.

For government sales inquiries, please contact governmentsales@.

For questions about sales outside the U.S., please contact intlcs@.

Visit us on the Web: aw

Library of Congress Control Number: 2019936408

Copyright ? 2019 Pearson Education, Inc.

Cover illustration: Open Studio/Shutterstock

All rights reserved. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, request forms and the appropriate contacts within the Pearson Education Global Rights & Permissions Department, please visit permissions/.

ISBN-13: 978-0-13-515994-1 ISBN-10: 0-13-515994-6

1 19

To my beautiful and brilliant mother, Betty P. M. Overland. . . . All the world is mad except for me and thee. Stay a little. --Brian

To my parents, who did so much to shape who I am. --John

This page intentionally left blank

Contents

Preface

xxiii

What Makes Python Special?

xxiii

Paths to Learning: Where Do I Start?

xxiv

Clarity and Examples Are Everything

xxiv

Learning Aids: Icons

xxv

What You'll Learn

xxvi

Have Fun

xxvi

Acknowledgments

xxvii

About the Authors

xxix

Chapter 1 Review of the Fundamentals

1

1.1 Python Quick Start

1

1.2 Variables and Naming Names

4

1.3 Combined Assignment Operators

4

1.4 Summary of Python Arithmetic Operators

5

1.5 Elementary Data Types: Integer and Floating Point

6

1.6 Basic Input and Output

7

1.7 Function Definitions

9

1.8 The Python "if" Statement

11

1.9 The Python "while" Statement

12

1.10 A Couple of Cool Little Apps

14

vii

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

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

Google Online Preview   Download