Python

Páginas: 193 (48078 palabras) Publicado: 5 de marzo de 2013
Fast Lane to Python
A quick, sensible route to the joys of Python coding

Norm Matloff University of California, Davis

This work is licensed under a Creative Commons Attribution-No Derivative Works 3.0 United States License. Copyright is retained by N. Matloff in all non-U.S. jurisdictions, but permission to use these materials in teaching is still granted, provided the authorship andlicensing information here is displayed. The author has striven to minimize the number of errors, but no guarantee is made as to accuracy of the contents of this book.

2 Author’s Biographical Sketch Dr. Norm Matloff is a professor of computer science at the University of California at Davis, and was formerly a professor of mathematics and statistics at that university. He is a former databasesoftware developer in Silicon Valley, and has been a statistical consultant for firms such as the Kaiser Permanente Health Plan. Dr. Matloff was born in Los Angeles, and grew up in East Los Angeles and the San Gabriel Valley. He has a PhD in pure mathematics from UCLA, specializing in probability theory and statistics. He has published numerous papers in computer science and statistics, with currentresearch interests in parallel processing, statistical computing, and regression methodology. Prof. Matloff is a former appointed member of IFIP Working Group 11.3, an international committee concerned with database software security, established under UNESCO. He was a founding member of the UC Davis Department of Statistics, and participated in the formation of the UCD Computer Science Department aswell. He is a recipient of the campuswide Distinguished Teaching Award and Distinguished Public Service Award at UC Davis. Dr. Matloff is the author of two published textbooks, and of a number of widely-used Web tutorials on computer topics, such as the Linux operating system and the Python programming language. He and Dr. Peter Salzman are authors of The Art of Debugging with GDB, DDD, andEclipse. Prof. Matloff’s book on the R programming language, The Art of R Programming, is due to be published in 2011. He is also the author of several open-source textbooks, including From Algorithms to Z-Scores: Probabilistic and Statistical Modeling in Computer Science (http://heather.cs.ucdavis.edu/probstatbook), and Programming on Parallel Machines(http://heather.cs.ucdavis.edu/˜matloff/ParProcBook.pdf).

Contents
1 Introduction 1.1 A 5-Minute Introductory Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.2 Example Program Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Python Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Loops . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . Python Block Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Python Also Offers an Interactive Mode . . . . . . . . . . . . . . . . . . . . . . . . Python As a Calculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 2 2 3 5 6 7 7 8 9 9

A 10-Minute Introductory Example . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 Example Program Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command-Line Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction to File Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . Lack of Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . .

Locals Vs. Globals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 A Couple of Built-In Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.3 1.4 1.5

Types of Variables/Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 String Versus Numerical Values . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Python
  • Por Qué Python?
  • PYTHON
  • python sonido
  • python
  • python
  • Python
  • Python

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS