|
 |
"Mr" <m******r******at_hotmail_dot_fr> wrote:
>...
> In python you can only have tab sized (4 spaces) indents like this, which looks
> more tidy/less error prone (though I understand people would like more
> flexibility and perhaps more compact concision) :
>...
> object:
> sphere:
> center<0, 0, 0>
> radius<1>
> material:
> texture:
> color<1, 0, 0>
> reflectivity<0.2>
>...
Hi Mr
Python allows 1 or more extra leading spaces for each indentation level.
So you can actually write code like this:
for x in range(10):
for y in range(10):
for z in range(10):
print(f'<{x}, {y}, {z}>')
if (x % 2) == 1:
print('---------')
what is recommended in pep8 is another matter:
https://peps.python.org/pep-0008/#indentation
And BTW: Tabs are evil!
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
 |