Re: Anyone know the solution

2014-10-29 Thread Denis McMahon
On Mon, 27 Oct 2014 08:10:04 -0700, emmanueloje wrote: Write a program ... Hey dudester I coded a solution for you, you can get it here: http://www.sined.co.uk/tmp/names.py.txt Make sure you leave all the comments in so your instructor realises how much effort you went in to in researching

Re: Anyone know the solution

2014-10-29 Thread Anton
On Tuesday, October 28, 2014 10:13:14 PM UTC-7, Gregory Ewing wrote: No, that's not the correct answer. Being NP-complete doesn't mean something is impossible, or even hard to do. All it means is that nobody knows of a cleverer solution than just trying all possibilities. That's only a

Re: Anyone know the solution

2014-10-28 Thread Mario R. Osorio
On Tuesday, October 28, 2014 12:25:13 AM UTC-4, Terry Reedy wrote: On 10/27/2014 11:10 AM, emmanuel...@gmail.com wrote: THIS IS THE LIST OF BOY NAMES Jacob ... Writing hundreds of unnecessary lines at minimum inconsiderate. Please don't do it. -- Terry Jan Reedy The python

Re: Anyone know the solution

2014-10-28 Thread ngangsia akumbo
This is a sample code on how to read data from a file files1 {} result = open(file1.txt) for line in result: file1 = linesplit() files1.append(file1) result.close() file1.sort() file1.reverse() print('THE FILE INFO') print(file1(0) print(file1(1) --

Re: Anyone know the solution

2014-10-28 Thread Cameron Simpson
On 28Oct2014 09:07, ngangsia akumbo ngang...@gmail.com wrote: This is a sample code on how to read data from a file files1 {} result = open(file1.txt) for line in result: file1 = linesplit() files1.append(file1) result.close() file1.sort() file1.reverse() print('THE FILE INFO')

Re: Anyone know the solution

2014-10-28 Thread Anton
On Monday, October 27, 2014 5:33:17 PM UTC-7, alex23 wrote: On 28/10/2014 1:10 AM, e...@gmail.com wrote: Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy's name, a girl's name or both, and the

Re: Anyone know the solution

2014-10-28 Thread alex23
On 29/10/2014 11:28 AM, Anton wrote: Can you elaborate why it is an NP-complete problem or maybe a link to description of problem you are referring to? While not the exact problem, it's tangentially related to: http://kenlevine.blogspot.com.au/2011/03/reducing-humor-to-equation.html --

Re: Anyone know the solution

2014-10-28 Thread Dave Angel
Cameron Simpson c...@zip.com.au Wrote in message: On 28Oct2014 09:07, ngangsia akumbo ngang...@gmail.com wrote: This is a sample code on how to read data from a file files1 {} result = open(file1.txt) for line in result: file1 = linesplit() files1.append(file1) result.close() file1.sort()

Re: Anyone know the solution

2014-10-28 Thread Gregory Ewing
On Monday, October 27, 2014 5:33:17 PM UTC-7, alex23 wrote: It is NP-complete, meaning that there is no easy solution. The correct answer is Not possible. No, that's not the correct answer. Being NP-complete doesn't mean something is impossible, or even hard to do. All it means is that

Re: Anyone know the solution

2014-10-27 Thread alister
On Mon, 27 Oct 2014 08:10:04 -0700, emmanueloje wrote: Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy's name, a girl's name or both, and the application will display messages indicating

Re: Anyone know the solution

2014-10-27 Thread Joel Goldstick
2014-10-27 11:10 GMT-04:00 emmanuel...@gmail.com: Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy's name, a girl's name or both, and the application will display messages indicating whether the names

Re: Anyone know the solution

2014-10-27 Thread Denis McMahon
On Mon, 27 Oct 2014 08:10:04 -0700, emmanueloje wrote: Write a program that reads the contents of the two files into two separate lists. Yep, know how to do that The user should be able to enter a boy's name, a girl's name or both Yep, know how to do that and the application will display

Re: Anyone know the solution

2014-10-27 Thread alex23
On 28/10/2014 1:10 AM, emmanuel...@gmail.com wrote: Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy's name, a girl's name or both, and the application will display messages indicating whether the names

Re: Anyone know the solution

2014-10-27 Thread Terry Reedy
On 10/27/2014 11:10 AM, emmanuel...@gmail.com wrote: THIS IS THE LIST OF BOY NAMES Jacob ... Writing hundreds of unnecessary lines at minimum inconsiderate. Please don't do it. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list