View Single Post
Old 09-17-2015, 02:26 AM   #19
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by cybmole View Post
that is interesting, could you talk us through it please.
I can intuit what most of the code is doing, but what is the significance of needing exactly 4 spaces in two locations?
It is Python code. Rather than using delimiters of some sort, Python uses the indent levels to indicate code blocks. The "def" line is defining a function. Any code lines in the function have to be indented under it. The indent is usually four spaces, but a single space or a tab should work.
davidfor is offline   Reply With Quote