File information: | |
File name: | python3handson.pdf [preview python] |
Size: | 829 kB |
Extension: | |
Mfg: | programming |
Model: | python 🔎 |
Original: | 1 🔎 |
Descr: | Python3handson |
Group: | Electronics > Automobile |
Uploaded: | 13-01-2015 |
User: | rockingsital |
Multipart: | No multipart |
Information about the files in archive: | ||
Decompress result: | OK | |
Extracted files: | 1 | |
File name python3handson.pdf Hands-On Python A Tutorial Introduction for Beginners Python 3.1 Version Dr. Andrew N. Harrington Computer Science Department, Loyola University Chicago © Released under the Creative commons Attribution-Noncommercial-Share Alike 3.0 United States License http://creativecommons.org/licenses/by-nc-sa/3.0/us/ Contents Chapter 1. Beginning With Python 1.1. Context 1.2. The Python Interpreter and Idle, Part I 1.3. Whirlwind Introduction To Types and Functions 1.4. Integer Arithmetic 1.5. Strings, Part I 1.6. Variables and Assignment 1.7. Print Function, Part I 1.8. Strings Part II 1.9. The Idle Editor and Execution 1.10. Input and Output 1.11. Defining Functions of your Own 1.12. Dictionaries 1.13. Loops and Sequences 1.14. Decimals, Floats, and Floating Point Arithmetic 1.15. Summary Chapter 2. Objects and Methods 2.1. Strings, Part III 2.2. More Classes and Methods 2.3. Mad Libs Revisited 2.4. Graphics 2.5. Files 2.6. Summary Chapter 3. More On Flow of Control 3.1. If Statements 3.2. Loops and Tuples 3.3. While Statements 3.4. Arbitrary Types Treated As Boolean 3.5. Further Topics to Consider 3.6. Summary Chapter 4. Dynamic Web Pages 4.1. Web page Basics 4.2. Composing Web Pages in Python 4.3. CGI - Dynamic Web Pages 4.4. Summary 4 4 6 11 12 14 15 16 17 17 19 23 31 35 45 47 53 53 59 61 66 88 90 93 93 105 109 120 122 123 126 126 128 131 138 3 CHAPTER 1 Beginning With Python 1.1. Context You have probablry used computers to do all sorts of useful and interesting things. In each application, the computer responds in different ways to your input, from the keyboard, mouse or a file. Still the underlying operations are determined by the design of the program you are given. In this set of tutorials you will learn to write your own computer programs, so you can give the computer instructions to react in the way you want. 1.1.1. Low-Level and High-Level Computer Operations. First let us place Python programming in the context of the computer hardware. At the most fundamental level in the computer there are instructions built into the hardware. These are very simple instructions, peculiar to the hardware of your particular type of computer. The instructions are designed to be simple for the hardware to execute, not for humans to follow. The earliest programming was done with such instructions. If was difficult and error-prone. A major advance was the development of higher-level languages and translators for them. Higher-level languages allow computer programmers to write instructions in a format that is easier for humans to understand. For example z = x+y is an instruction in many high-level languages that means something like: (1) Access the value stored at a location labeled x (2) Calculate the sum of this value and the value stored at a location labeled y (3) Store the result in a location labeled z. No computer understands the high-level instruction directly; it is not in machine language. A special program must first translate instructions like this |
Date | User | Rating | Comment |