Creating a Program to Decompose a Number and Run a Function on that Decomposition

CTSB01 scott.moore270 at gmail.com
Thu Jul 18 18:18:37 EDT 2013


On Thursday, July 18, 2013 6:12:52 PM UTC-4, Gary Herron wrote:
> On 07/18/2013 02:57 PM, CTSB01 wrote:
> 
> > On Thursday, July 18, 2013 5:12:08 AM UTC-4, Joshua Landau wrote:
> 
> >> On 18 July 2013 00:58, CTSB01 <scott.moore270 at gmail.com> wrote:
> 
> >>
> 
> >>> Please let me know if this is unclear.  I will certainly continue revising until it makes sense to those reading.
> 
> >>
> 
> >>
> 
> >> Can you summarize what your question is? Leave aside the details of
> 
> >>
> 
> >> the function, just explain what thing in particular you aren't able
> 
> >>
> 
> >> to do.
> 
> > Hi Joshua,
> 
> >
> 
> > I actually managed to find a certain block like this:
> 
> >
> 
> >   def phi_m(x, m):
> 
> > ...   rtn = []
> 
> > ...   for n2 in range(0, len(x) * m - 2:
> 
> That 'for' line has miss-matched parentheses.
> 
> > ...     n = n2 / m
> 
> > ...     r = n2 - n * m
> 
> > ...     rtn.append(m * x[n] + r * (x[n + 1] - x[n]))
> 
> > ...     print 'n2 =', n2, ': n =', n, ' r =' , r, ' rtn =', rtn
> 
> > ...   rtn
> 
> >
> 
> > However, I am getting the error "expected an indented block" on line two.  Any idea why?
> 
> 
> 
> 
> 
> -- 
> 
> Dr. Gary Herron
> 
> Department of Computer Science
> 
> DigiPen Institute of Technology
> 
> (425) 895-4418

Hi Gary,

I fixed that issue, but I still end up with the same error.  Specifically:

		      
  File "<pyshell#9>", line 2
    ...   rtn = []
    ^
IndentationError: expected an indented block



More information about the Python-list mailing list