On 7/26/09, Dave Angel wrote:
> Chris Castillo wrote:
>> ya i was kind of in a hurry composing the email earlier. sorry for the
>> typos and misunderstanding. This is what I actually have.
>>
>> grades = []
>> names = []
>> gradeTotal = 0
>> numStudents = 0
>>
>> inputFile = open("input.txt", "r")
Chris Castillo wrote:
ya i was kind of in a hurry composing the email earlier. sorry for the
typos and misunderstanding. This is what I actually have.
grades = []
names = []
gradeTotal = 0
numStudents = 0
inputFile = open("input.txt", "r")
for line in inputFile:
if line.strip().isdigit():
ya i was kind of in a hurry composing the email earlier. sorry for the
typos and misunderstanding. This is what I actually have.
grades = []
names = []
gradeTotal = 0
numStudents = 0
inputFile = open("input.txt", "r")
for line in inputFile:
if line.strip().isdigit():
grade = float(li
ctc...@gmail.com wrote:
grades = []
names = []
gradeTotal = 0
numStudents = 0
inputFile = open("input.txt", "r"
for line in inputFile:
if line.strip().isdigit():
grade = float(line)
if grade != 0.0:
gradeTotal += grade
grade = grades.append(grade)
else:
name = line.strip()
name = names.append(n
grades = []
names = []
gradeTotal = 0
numStudents = 0
inputFile = open("input.txt", "r"
for line in inputFile:
if line.strip().isdigit():
grade = float(line)
if grade != 0.0:
gradeTotal += grade
grade = grades.append(grade)
else:
name = line.strip()
name = names.append(name)
This just loops ove
I concur with wesley and dave re homework.
Some questions to consider:
do you know how to open a file?
do you know how to read a line from an opened file?
do you know how to incorporate reading lines in a loop?
do you know how to determine whether a character is "numeric"?
do you know how to
Chris Castillo wrote:
Okay I really need help with the program I am writing. I've can't seem to
figure out what I need to do and have tried several different methods.
I need to read in a text file in python that contains the following:
Student Name ( could be unknown amount in file )
Numeric G
On Fri, Jul 24, 2009 at 11:40 PM, Chris Castillo wrote:
> Okay I really need help with the program I am writing. I've can't seem to
> figure out what I need to do and have tried several different methods.
hi chris, and welcome to Python! the tutors here are very helpful to
those who are new to pr
Okay I really need help with the program I am writing. I've can't seem to
figure out what I need to do and have tried several different methods.
I need to read in a text file in python that contains the following:
Student Name ( could be unknown amount in file )
Numeric Grade ( could be unknown