Re: [Tutor] Python 3.3 on OpenSUSE 12.3

2013-10-25 Thread Rafael Knuth
Hello Jay, thanks for your reply. On Thu, Oct 24, 2013 at 11:45 PM, Jay Lozier wrote: > On Thu, 2013-10-24 at 21:57 +0200, Rafael Knuth wrote: > > Hej, > > I can't get Python 3.3 up and running (it's properly installed but I > > can't launch it), and I was wondering if anyone using OpenSUSE 12

Re: [Tutor] Python and memory allocation

2013-10-25 Thread Dave Angel
On 25/10/2013 08:20, #PATHANGI JANARDHANAN JATINSHRAVAN# wrote: > Hello All, > >>Similarly, if you call sorted() on a list of large strings, > you get a new list, but the strings are not duplicated, so it's not > nearly the duplication it might look like. > > 1. Sorry, but I did not understand t

Re: [Tutor] Count Help

2013-10-25 Thread Konrad Korżel
It's better to use the "with open" statement to open the file and then process it line by line with occurrence counter, like: def occurence(pathToFile, substring): substringCount = 0 with open(pathToFile, 'r') as src: for line in src: substringCount += line.count(substr

Re: [Tutor] python question

2013-10-25 Thread Alan Gauld
On 25/10/13 09:13, Amir Fawzi wrote: Exercise 7.4. Make a class for straight lines. Make a class Line whose constructor takes two points p1 and p2 (2- tuples or 2-lists) as input. The line goes through these two points (see function line in Chapter 3.1.7 for the relevant formula of the line).

[Tutor] python question

2013-10-25 Thread Amir Fawzi
Hi! I am trying to do an exercise abt classes, but I find it really hard even after reading. I have tryed to start it at the bottom of this document. I hope someone can help me. I have to submit the question by sunday. Exercise 7.4. Make a class for straight lines. Make a class Line whose con

Re: [Tutor] Python and memory allocation

2013-10-25 Thread #PATHANGI JANARDHANAN JATINSHRAVAN#
Hello All, >Similarly, if you call sorted() on a list of large strings, you get a new list, but the strings are not duplicated, so it's not nearly the duplication it might look like. 1. Sorry, but I did not understand the above point. 2. My interpretation of your answer is that the stack memo