Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-21 Thread Martin A. Brown
Marcus, I have more questions for you, as well as a possible solution (though it's a bit more verbose than I would have liked to offer). Question: Problem A: Are you looking to identify the complete set of possible options for constructing the triples of pairs? Problem B: Are you loo

Re: [Tutor] Creating a match file

2015-09-21 Thread Emile van Sebille
On 9/20/2015 12:19 PM, EILEEN CHURCH CARSON wrote: I want to write a program that reads in data from two csv files with 6 columns each. I want it to determines if the data in the first two columns is the same, and if so read all six columns in that line from each of the two files into a 12 colum

Re: [Tutor] Creating lists with definite (n) items without repetitions

2015-09-21 Thread Francesco A. Loffredo via Tutor
On 15/09/2015 23.14, Francesco A. Loffredo wrote: On 14/09/2015 13:50, Oscar Benjamin wrote: ... Your algorithm loops through all triples and accepts any triple if it doesn't immediately conflict with any of the triples already accepted. If you were solving a sud

Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-21 Thread Martin A. Brown
Hello again Marcus, My task is to have lists containing 3 tuples, each tuple ocurring only once. In my code above I started off with 6 tuples ( = s) of which 20 lists (count) are produced containing each of the 6 tuples multiple times. Below, I'm confirming that there are 325 input "tuples"

Re: [Tutor] Doubly linked list getting "AttributeError: 'NoneType' object has no attribute 'element'"

2015-09-21 Thread Steven D'Aprano
Hi Sudhier, and welcome, Unfortunately I'm about to step away from the computer, so I can't really answer your question in detail, but since it's been 2 or 3 days since you asked your question, and I haven't seen any replies at all, I thought I'd give a quick reply so you know we aren't ignorin

Re: [Tutor] Creating a match file

2015-09-21 Thread Peter Otten
EILEEN CHURCH CARSON wrote: > I want to write a program that reads in data from two csv files with 6 > columns each. I want it to determines if the data in the first two columns > is the same, and if so read all six columns in that line from each of the > two files into a 12 column output file. >

Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-21 Thread marcus lütolf
Hi Alan G, thanks for your quick answer. The copy of my code below, sent on 18/09/15 16:41 is for some reasons incomplete. It should read >>> import string, itertools >>> s = ['ab','ac','bc','ad','ae','de'] >>> count = 0 >>> for startlist in itertools.combinations(s, 3): >>> count = count +

[Tutor] Doubly linked list getting "AttributeError: 'NoneType' object has no attribute 'element'"

2015-09-21 Thread Sudhier Batara
Hi, I have the below code which is a doubly linked list , which returns the Position of the node rather than the node itself.The code is quite self explanatory.In the below code i call following methods , p = L.add_last(8) print p.element() the above methods works fine adds the element into the

[Tutor] Creating a match file

2015-09-21 Thread EILEEN CHURCH CARSON
Hi there, I want to write a program that reads in data from two csv files with 6 columns each. I want it to determines if the data in the first two columns is the same, and if so read all six columns in that line from each of the two files into a 12 column output file. Please let me know if you k