View Single Post
Old 08-17-2011, 01:44 PM   #7
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,578
Karma: 79436940
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
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"
PeterT is offline   Reply With Quote