<div dir="ltr"><div><div> def __init__(self, int1 = 1, int2 = 1, int3 = 1, int4 = 0):<br> self.int1 = int1<br> self.int2 = int2<br> self.int3 = int3<br> self.int4 = int4<br><br></div>1,2,3,4 hard coded is generally a red flag that you should be using a list.<br><br></div>I didn't look at what the code is doing, but you should be able to replace all the int1 with i[1]<br><div>(don't use int[1], int is a reserved word)<br><br></div><div>Step 2: Once you have that working, you should be able to replace all the 1,2,3,4's with for n in range(1,5): i[n]<br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 17, 2015 at 12:30 AM, Lewit, Douglas <span dir="ltr"><<a href="mailto:d-lewit@neiu.edu" target="_blank">d-lewit@neiu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font size="4">I think this works! Yay!!! Although I would like to make it more general for any integer n besides 4. Do I really need int1, int2, int3, int4? I think all I need is the initial vector = [1, 1, 1, 1, ......, 0].</font><div><font size="4"><br></font></div><div><font size="4">Gotta go! Oh yeah, code here is in Python 3. Not sure how well it will run in Python 2. I don't know when Python 4 is coming out, but if it's not backward compatible with Python 3 I have a feeling A LOT of folks in the Python community are going to be very, very upset!</font></div><div><font size="4"><br></font></div><div><font size="4">Best,</font></div><div><font size="4"><br></font></div><div><font size="4">Doug.</font></div></div>
<br>_______________________________________________<br>
Chicago mailing list<br>
<a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/chicago" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/chicago</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Carl K<br><br></div></div></div></div></div>
</div>