'A Byte of Python' is a book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you.
......(更多)
Swaroop C H is 27 years of age. He is currently a Product Leader at Infibeam, one of the largest ecommerce companies in India. He has previously worked at Yahoo!, Adobe and his own startup.
......(更多)
Table of Contents
1. Welcome
2. Dedication
3. Preface
4. Introduction
5. Installation
6. First Steps
7. Basics
8. Operators and Expressions
9. Control Flow
10. Functions
11. Modules
12. Data Structures
13. Problem Solving
14. Object Oriented Programming
15. Input and Output
16. Exceptions
17. Standard Library
18. More
19. What Next
20. Appendix: FLOSS
21. Appendix: Colophon
22. Appendix: History Lesson
23. Appendix: Revision History
24. Translations
25. Translation Howto
......(更多)
Python的for循环与C#中的foreach循环十分类似。Java程序员会注意到它与Java 1.5中的for (int i : IntArray)相似。 在C/C++中,如果你想要写for (int i = 0; i < 5; i++) ,那么用Python,你写成for i in range(0,5)。
含有0个或1个项目的元组: 一个空的元组由一对空的圆括号组成,如myempty = ()。然而,含有单个元素的元组就不那么简单了。你必须在第一个(唯一一个)项目后跟一个逗号,这样Python才能区分元组和表达式中一个带圆括号的对象。即如果你想要的是一个包含项目2的元组的时候,你应该指明singleton = (2 ,)。
......(更多)