Unlike many programming tools that use
BEGIN /
END or
{ } to group together sections of code, Python uses
spaces or
indentation to make the same sections of code.
So for instance C might do
Code:
printf("before if\n");
if ( a == 0) {
printf("a is zero\n");
} else {
printf("a is non zero\n");
}
printf("end of if\n");
Python would do
Code:
print "before if"
if a == 0:
print "a is zero"
else:
print "a is not zero"
print "after if"