November 7th, 2012, 04:25 PM
-
*ITEM COUNTER* help
Assume that a file containing a series of integers is named numbers.txt and exists on the
computer’s disk. Write a program that calculates the average of all the numbers stored in
the file.
November 7th, 2012, 06:20 PM
-
Can you post what you have on this so far? Do you have any specific questions we might be able to answer?
November 7th, 2012, 06:35 PM
-
Originally Posted by Schol-R-LEA
Can you post what you have on this so far? Do you have any specific questions we might be able to answer?
This is what i have so far. I have a text file with some 6 random names in it. I'm not sure where to go from here to get the program to display the number of names.
def main():
# Open the names.txt file.
in_file = open('names.txt', 'r')
# Read the first line from the file, which is
# the name field of the first record.
name = in_file.readline()
November 7th, 2012, 07:13 PM
-
Originally Posted by Schol-R-LEA
Can you post what you have on this so far? Do you have any specific questions we might be able to answer?
This is what i have so far. I have a text file with some 6 random names in it. I'm not sure where to go from here to get the program to display the number of names.
def main():
# Open the names.txt file.
in_file = open('names.txt', 'r')
# Read the first line from the file, which is
# the name field of the first record.
name = in_file.readline()
November 7th, 2012, 08:19 PM
-
jwhit1984: Please have an educated, intelligent, sane, sober friend read your posts in this thread and have this friend then explain to the irrationality of it all.
[code]
Code tags[/code] are essential for python code and Makefiles!