New to Python - block grouping (spaces)
antoon.pardon at rece.vub.ac.be
Thu Apr 16 14:48:32 CEST 2015
On 04/16/2015 06:07 AM, Blake McBride wrote:
> I am new to Python. I am sorry for beating what is probably a dead horse but I checked the net and couldn't find the answer to my question.
> I like a lot of what I've seen in Python, however, after 35 years and probably a dozen languages under my belt, I very strongly disagree with the notion of using white space to delimit blocks. Not wanting to beat what I believe is probably a dead horse, I have one question.
> Is there a utility that will allow me to write Python-like code that includes some block delimiter that I can see, that converts the code into runnable Python code? If so, where can I find it?
> Blake McBride
If you really want this, and don't like using comments to achieve this,
you can do the folling.
endfor = endif = enddef = endwhile = None
def poweri(a, i):
if i < 0:
i = -i
fac = 1.0 / a
fac = a
total = 1
if i % 2:
total *= fac
fac *= fac
i /= 2
More information about the Python-list