Re: how to iterate through each set

2007-11-04 Thread Cameron Walsh
Tom_chicollegeboy wrote: > I figured out problem. here is my code. now it works as it should! > Thank you everyone! > I decided my 4th clue earlier was too much, so I removed it before posting. It looks like you got it anyway =) You've now solved it the way the course instructor intended you to

Re: how to iterate through each set

2007-11-03 Thread Tom_chicollegeboy
I figured out problem. here is my code. now it works as it should! Thank you everyone! def speed(): infile = open('speed.in', 'r') line = infile.readline() read = int(line) while '-1' not in line: i = 0 t0 = 0 v = 0 if len(line.split())==1:

Re: how to iterate through each set

2007-11-03 Thread Tom_chicollegeboy
On Nov 4, 12:47 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sat, 03 Nov 2007 21:30:10 -0700, Tom_chicollegeboy > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > It works only for first set. How should I implement another solution > > that would move program to r

Re: how to iterate through each set

2007-11-03 Thread Tom_chicollegeboy
On Nov 4, 12:18 am, Cameron Walsh <[EMAIL PROTECTED]> wrote: > Tom_chicollegeboy wrote: > > > > > Here is my code: > > > def speed(): > > infile = open('speed.in', 'r') > > line = infile.readline() > > read = int(line) > > print line > > i = 0 > > t0 = 0 > > v = 0 > > >

Re: how to iterate through each set

2007-11-03 Thread Cameron Walsh
Tom_chicollegeboy wrote: > > > Here is my code: > > def speed(): > infile = open('speed.in', 'r') > line = infile.readline() > read = int(line) > print line > i = 0 > t0 = 0 > v = 0 > > while i line = infile.readline() > list = line.split() >

how to iterate through each set

2007-11-03 Thread Tom_chicollegeboy
I am begginer in learning Python language. My assignment is to iterate through each set and display results. this is text of assignment: Bill and Ted are taking a road trip. But the odometer in their car is broken, so they don't know how many miles they have driven. Fortunately, Bill has a workin