没有合适的资源?快使用搜索试试~ 我知道了~
首页annotated algorithms in python
annotated algorithms in python
需积分: 9 69 浏览量
更新于2023-03-16
评论
收藏 3.35MB PDF 举报
A N N OTAT E D A L G O R I T HMS I N P Y T H O N; WI T H A P P L I C AT I O N S I N P H Y S I C S , B I O L O G Y, A N D F I N A N C E ( 2 N D E D ); Copyright 2013 by Massimo Di Pierro. All rights reserved.
资源详情
资源评论
资源推荐

M A S S I M O D I P I E R R O
A N N O TAT E D A L G O R I T H M S I N P Y T H O N
W I T H A P P L I C AT I O N S I N P H Y S I C S , B I O L O G Y, A N D F I N A N C E ( 2 N D E D )
E X P E R T S 4 S O L U T I O N S

Copyright 2013 by Massimo Di Pierro. All rights reserved.
THE CONTENT OF THIS BOOK IS PROVIDED UNDER THE TERMS OF THE CRE-
ATIVE COMMONS PUBLIC LICENSE BY-NC-ND 3.0.
http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode
THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.
ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE
OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT
AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EX-
TENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR
GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR
ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have
used their best efforts in preparing this book, they make no representations or
warranties with respect to the accuracy or completeness of the contents of this book
and specifically disclaim any implied warranties of merchantability or fitness for a
particular purpose. No warranty may be created or extended by sales representatives
or written sales materials. The advice and strategies contained herein may not be
suitable for your situation. You should consult with a professional where appropriate.
Neither the publisher nor the author shall be liable for any loss of profit or any other
commercial damages, including but not limited to special, incidental, consequential, or
other damages.
For more information about appropriate use of this material, contact:
Massimo Di Pierro
School of Computing
DePaul University
243 S Wabash Ave
Chicago, IL 60604 (USA)
Email: massimo.dipierro@gmail.com
Library of Congress Cataloging-in-Publication Data:
ISBN: 978-0-9911604-0-2
Build Date: June 6, 2017

to my parents


Contents
1 Introduction 15
1.1 Main Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2 About Python . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.3 Book Structure . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.4 Book Software . . . . . . . . . . . . . . . . . . . . . . . . . 21
2 Overview of the Python Language 23
2.1 About Python . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.1.1 Python versus Java and C++ syntax . . . . . . . . 24
2.1.2 help, dir . . . . . . . . . . . . . . . . . . . . . . . . 24
2.2 Types of variables . . . . . . . . . . . . . . . . . . . . . . . 25
2.2.1 int and long . . . . . . . . . . . . . . . . . . . . . . 26
2.2.2 float and decimal . . . . . . . . . . . . . . . . . . . 27
2.2.3 complex . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.2.4 str . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.2.5 list and array . . . . . . . . . . . . . . . . . . . . . 31
2.2.6 tuple . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2.7 dict . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.2.8 set . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.3 Python control flow statements . . . . . . . . . . . . . . . 38
2.3.1 for...in . . . . . . . . . . . . . . . . . . . . . . . . 38
2.3.2 while . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.3.3 if...elif...else . . . . . . . . . . . . . . . . . . . 41
2.3.4 try...except...else...finally . . . . . . . . . . . 41
2.3.5 def...return . . . . . . . . . . . . . . . . . . . . . . 43
剩余387页未读,继续阅读
















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0