Re: [Tutor] new to python

2017-07-25 Thread N6Ghost
On 7/23/2017 1:03 AM, Alan Gauld via Tutor wrote: On 23/07/17 07:26, N6Ghost wrote: f = open("C:\coderoot\python3\level1\inputfile.txt", 'r') for line in file: Note that you have no variable called 'file'. So this line doesn't make sense. for line in f: print(line.rstripe()

[Tutor] Study Python was: Re: Tutor Digest, Vol 161, Issue 36

2017-07-25 Thread Alan Gauld via Tutor
On 24/07/17 18:41, Borisco Bizaro wrote: > Please what is the best way to study python programming well. One important skill is to read and follow instructions. For example... > On Jul 24, 2017 17:00, wrote: > >> Send Tutor mailing list submissions to >> tutor@python.org >> ... >> >> Wh

Re: [Tutor] new to python

2017-07-25 Thread Andre Engels
The problem here is that you have doubled the "for line in f:" line. Given that you say you know some programming, I'll just cut to the technical name of the problem you are having: You are changing the value of a loop variable (by starting an inner loop with the same loop variable) inside a loop.

Re: [Tutor] new to python

2017-07-25 Thread Alan Gauld via Tutor
On 25/07/17 04:58, N6Ghost wrote: > this code works > f = open("C:/coderoot/python3/level1/inputfile.txt", 'r') > for line in f: > for line in f: > #print(line.rstrip()) > print(line) > > f.close() > the out put skips the first line of the inputfile and puts a blank line