1. 首页
  2. 课程学习
  3. 讲义
  4. StartingOutWithPython

StartingOutWithPython

上传者: 2019-05-13 20:51:10上传 PDF文件 23.97MB 热度 112次
美国高校Ivy League的Python入门教程,很适合入门学习用RQASTARTING OUT WITHPYTHON□口□□THIRD EDITIONGLOBAL EDITIONREⅤ ISED PAGES a apartRQAREⅤ ISED PAGES a apartRQASTARTING OUT WITHPYTHONTHIRD EDITIONGLOBAL EDITIONTony GaddisHaywood Community CollegeGlobal Edition contributions byRashi agarwalUIET KanpurPEARSONBoston Columbus Indianapolis New York San Francisco Upper Saddle RiverAmsterdam Cape Town Dubai London Madrid Milan Munich Paris Montrcal TorontoDelhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei TokyoREⅤ ISED PAGES a apartRQAEditorial Director: Marcia hortonManufacturing Buyer: Linda sagerAcquisitions Editor: Matt GoldsteinArt Director: Jayne ConteProgram Manager: Kayla Smith -TarboxCover Designer: Bruce kenselaarDirector of Marketing: Christy LeskoManager, Rights and Permissions: Timothy NichollsMarketing Manager: Yexan alayanText Permissions: Jenell ForschlerMarketing Assistant: Jon BryantCover Image: O nature photos /ShutterstockDirector of Production: Erin gregCover Designer: Lumina Datamatics LtdManaging Editor: Scott DisannoMedia Project Manager: Renata buteraSenior Production Project Manager: Marilyn Lloyd Full-Service Project Managerment: Jogender tanejaHcad, Lcarning Assct Acquisitions, Global Edition: iEnergizer Aptara, neLaura dentComposition: iEnergier Aptara, Inc.Acquisition Editor, Global Edition: Adilee Agarwal Cover Printer/Binder: Ashford Colour PressProjcct Editor, Global Edition: Anuprova DeyPearson education LimitedEdinburgh gateHarloEssex CM20 2JEF1gand Associated Companies throughout the worldVisit us on the World Wide Web at:www.pearsonglobaleditions.comPearson Education Limited 2015The rights of Tony Gaddis to be identified as the author of this work have been asserted by hin in accordancewith thc Copyright, Designs and Patents Act 1988Authorized adaptation from the United states edition, entitled starting Out With Python, 3rd edition, ISBN978-0-13-358273-4, by Tony Gaddis, published by pearson Education O 2015All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmittedin any form or by any mcans, clectronic, mcchanical, photocopying, recording or otherwise, without cither theprior written permission of the publisher or a license permitting restricted copying in the United Kingdomissued by the Copyright Licensing Agency Ltd, Saffron House, 6-10 Kirby Street, London ECIN 8TSAll trademarks used herein are the property of their respective owners. The use of any trademark in this textdoes not vest in the author or publisher any trademark ownership rights in such trademarks, nor does the useof such trademarks imply any affiliation with or endorsement of this book by such ownersCredits and acknowledgments borrowed from other sources and reproduced, with permission, appear on theappropriate page within the textbookMicrosoft@ and Windows@ are registered trademarks of the Microsoft Corporation in the U.S. A and othercountries. This book is not sponsored or endorsed by or affiliated with the microsoft CorporationISBN10:1292065508ISBN13:978-1-29-206550-2109876543211413121110British Library Cataloguing-in-Publication DataA catalogue record for this book is available from the British libraryTypcsct in 9 Sabon LT Std by iEncrgizcr Aptara, Inc.Printed and bound by ashford DigitalThe publisher's policy is to use paper manufactured from sustainable forestsREⅤ ISED PAGES a apartRQAContents in a glancePreface 11Chapter 1 Introduction to Computers and Programming9Chapter 2 Input, Processing, and Output49Chapter 3 Decision Structures and Boolean Logic99Chapter 4 Repetition Structures139Chapter 5 Functions183Chapter 6 Files and Exceptions253Chapter 7 Lists and tuples309Chapter 8 More About Strings357cer9 Dictionaries and sets387Chapter 10 Classes and object-Oriented Programming437Chapter 1 1 Inheritance499Chapter 12 Recursion525Chapter 13 GUI Programming545Appendix a Installing Python583Appendix B Introduction to IDLE587Appendix c The asCll Character Set595Appendix d Answers to Checkpoints597Index613REⅤ ISED PAGES a apartRQAREⅤ ISED PAGES a apartRQAContents口口□□PrefaceChapter 1 Introduction to Computers and Programming191.1 Introduction191.2 Hardware and Software201.3 How Computers store data251.4 How a Program Works301.5 Using PythonChapter 2 Input, Processing, and output492.1 Designing a Program492.2 Input, Processing, and Output532. 3 Displaying Output with the print Function542. 4 Comments572. 5 Variable582.6 Reading Input from the Keyboard672.7 Performing Calculations712. 8 More About Data Output83Chapter 3 Decision Structures and Boolean logic993.1 The if Statement993.2 The if-else statement1083.3 Comparing string1113.4 Nested Decision Structures and the if-elif-else Statement1153.5 Logical Operators1233.6 Boolean variable129Chapter 4 Repetition Structures1394.1 Introduction to Repetition Structures1394.2 The while Loop: A Condition-Ceontroolled Loop144.3 The for Loop: A Count-Controlled Loop1484.4 Calculating a running Total1594.5 Sentinels1624.6 Input Validation Loops1654.7 Nested Loops170REⅤ ISED PAGES a apartRQA8ContentChapter 5 Functions1835. 1 Introduction to Functions1835.2 Defining and Calling a Void Function1865.3 Designing a Program to Use Functions1915.4 Local variable1975.5 Passing Arguments to Functions1995.6 GIan7 Introduction to Value-Returning FunctionsGenerating Random Numbers215.8 Writing Your Own Value-Returning Functions2245.9 The math Module5.10 Storing Functions in Modules3823Chapter 6 Files and Exceptions2536.1 Introduction to File Input and Output2536.2 USing loops to process files2706.3 Processing Records6.4 Exceptions290Chapter 7 Lists and Tuples3097.1 Sequences3097.2 Introduction to lists3097. 3 List Slicing3177.4 Finding Items in Lists with the in Operator3207.5 List Methods and Useful Built-in functions3217.6 Copying Lists3287.7 Processing Lists3307.8 Two-Dimensional lists3427.9 Tuples346Chapter8 More About Strings3578.1 Basic String Operations3578.2 String slicing3658.3 Testing, Searching, and Manipulating StringsChapter9 Dictionaries and Sets3879.1 Dictionaries3879.2 Sets9.3 Serializing Objects422Chapter 10 Classes and object-Oriented Programming43710. 1 Procedural and Object-Oriented Programming10.2 Classes10.3 Workinh i45810.4 Techniques fornIl480Chapter 11 Inheritance49911.1 Introduction to Inheritance11.2PolyInlorphisIn514REⅤ ISED PAGES a apart
用户评论