Essentially, whitespace is used instead of punctuation to specify a
"block" of code (I lifted this example from Wikipedia):
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x-1)
While in C, it would be (again, from Wikipedia):
int factorial(int x) {
if (x == 0) {
return(1);
} else {
return(x * factorial(x-1));
}
}
Basically the same thing, and I find it to be a little easier to read
without all those brackets, but that's me, and I have friends who can't
stand it and prefer the obviousness of the brackets. There's more to
it, but that's basically the point behind the whitespace in Python.
-Jim
Angel Stewart wrote:
> Whitespace in the code is important?
>
>
> In this day and age that seems pretty backward :-)
>
>
> -Gel
>
> -----Original Message-----
> From: Jim Campbell [mailto:[EMAIL PROTECTED]
>
> :) On the internet, no one can see you laughing. That, and pretty much
> any Python IDE will keep your code nice and clean. I've made the
> mistake of writing Python in Notepad and had way too many problems with
> just that.
>
> - Jim
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

