Hey Guys - Long time no, err, speak! I need help.
1 post
• Page 1 of 1
Hey Guys - Long time no, err, speak! I need help.
So yeah! I've been working on my python all day, and I'm still none the closer.
basically, I have to write a program that reads from a text file, the text file reads as follows
gary, 90, 90, 90
steve, 90, 90, 90
adam, 90, 90, 90
the variables are
Name, Score1, Score2, Score3
I have to write a code that works out the average of the individual scores, and prints a message if one of the scores is below 40, I have no idea, any help would be great...
this is what I have so far..
- Code: Select all
def FileRead():
Welcome()
print "This program is for reading the list file\n\n"
infile = open("FileWrite.txt","r")
for line in infile:
thisLine = line[0:len(line)-1];
items = thisLine.split(",")
print "Items read are: 'Name'", items[0],"'Python Score'", items[1],"'Syard Score'",items[2],"'Learn Score'",items[3]
infile.close()
print"\nfile loaded,"
Thanks guys, Gary.
<img border="0" src="Http://GazR88.pwp.blueyonder.co.uk/GazR.jpg" width="480" height="180">
1 post
• Page 1 of 1
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 10 guests