Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-19 Thread Scurvy Scott
[SNIP] Thank you guys so much, sorry for the delayed response. It's awesome being able to learn a thing or two from people who know so much about their craft. I've got the code working the way I envisioned it now and probably couldn't without y'alls help. I'm so glad this mailing list exists, tha

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-16 Thread Steven D'Aprano
On 16/01/13 11:23, Scurvy Scott wrote: After playing with your example I keep being told that list has no attribute int_to_note. I know what the problem is, I just don't know how to fix it. Oops, sorry about that, that is my fault. I did warn that my code was untested! If you know what the pr

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Andreas Perstinger
On 16.01.2013 01:23, Scurvy Scott wrote: > After playing with your example I keep being told that list has no > attribute int_to_note. I know what the problem is, I just don't know > how to fix it. [SNIP] > So right now my code is: > > import mingus.core.notes as notes

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
>> So here I extract out of your code (untested!) a generator which produces >> an infinite series of Fibonacci numbers, one at a time: >> >> def fib(): >> >> a, b = 0, 1 >> while True: >> yield b >> >> a, b = b, a+b >> >> >> This is untested, I may have got it wrong. >> >>

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
On Tue, Jan 15, 2013 at 4:01 PM, Steven D'Aprano wrote: > On 16/01/13 10:40, Scurvy Scott wrote: > [...] > >> Anyways, the problem I'm having is I'm not really sure how to search a >> list >> for multiple elements and remove just those elements. Below is my code so >> far, and information y'all co

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 23:53, Scurvy Scott wrote: >> > Anyways, the problem I'm having is I'm not really sure how to search a list >> > for multiple elements and remove just those elements. Below is my code so >> > far, and information y'all could provide would be appreciated. Thanks. >> [SNIP] > > Wh

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Steven D'Aprano
On 16/01/13 10:40, Scurvy Scott wrote: [...] Anyways, the problem I'm having is I'm not really sure how to search a list for multiple elements and remove just those elements. Below is my code so far, and information y'all could provide would be appreciated. Thanks. Actually, your problem so far

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 23:40, Scurvy Scott wrote: [SNIP] > > Anyways, the problem I'm having is I'm not really sure how to search a list > for multiple elements and remove just those elements. Below is my code so > far, and information y'all could provide would be appreciated. Thanks. Perhaps you'd l

[Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
Hello guys, I'm using Ubuntu 12.10 and Python 2.7 right now. I'm working on code using the Mingus module but this question isn't specific to this module, per se. What I'm trying to do is to generate the fibonacci numbers up to a given N and then do modulo 12 on each number in order to create a lis