Date: 02/18/06 18:00:09
Cc: Tutor
Subject: Re: [Tutor] Need to write a python and call it within a python mainprogram (fwd)
 
?
 
Indentation is how python determines block sytructure.
 
 
In Python a colon says a block is coming up and everything up to the
next unindented line is part of it. But the indentation must be consistent
(it can be as big or little as you like, but it must be consistent - 2, 3 or
4
spaces is pretty normal)
 
In your case the body of the function had inclonsistent indentation.
 
The other issue is in the format of your if statements:
 
.....    if j = 0,  a,b,c,d = a/2,b/2,c/2,d/2
 
You need to use == as in C for comparisons, unlike C you cannot
do an assignment in a test. The condition must be followed by a colon.
You test thus becomes:
 
if j == 0: a,b,c,d = a/2,b/2,c/2,d/2
 
Note the double equals and the colon.
 
HTH,
 
*****
 
Thank you very much!
 
Kermit  <  [EMAIL PROTECTED]  >
 
 
 
 
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to