Newbie White Space
Edward C. Jones
edcjones at erols.com
Thu Mar 30 14:22:49 EST 2000
More information about the Python-list mailing list
Thu Mar 30 14:22:49 EST 2000
- Previous message (by thread): Tcl/Tk Path problems in Python 1.5.2 installation
- Next message (by thread): Python x ibook (Mac)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <8bc1oo$qjc$1 at yeppa.connect.com.au>, ... "does Python check white space" ... Python does not make blocks using {} like C. It uses indents instead. End-of-line means end-of-statement unless a "\" is at the end of the line. In the examples, I will use a "^" where ever I want a space. while^1^==^1: ^^^^print^'infinite^loop' #^Print^a^list^of^integers^and^their^squares. for^i^in^range(10): ^^^^print^i ^^^^print^i**2 #^Print^all^combinations^of ^a^letter^followed^by^a^number. for^letter^in^'ABCDEFGHIJKLMNOPQRSTUVWXYZ': ^^^^for^numeral^in^'0123456789': ^^^^^^^^print^letter^+^numeral Indenting is the big difference between Python and other languages. It is, surprisingly, not all that well documented. Go to http://www.python.org/. Read the Python Tutorial, Section 3.2. Then find the Python Reference Manual, and look at section 2.1.7.
- Previous message (by thread): Tcl/Tk Path problems in Python 1.5.2 installation
- Next message (by thread): Python x ibook (Mac)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list