First of all, you have to define how the data is stored. Are the numbers separated by ',' or by spaces... That's the most important : knowing how your numbers are stored in the file.
I assume all your numbers are written on one line and separated by ','.
- open the file
- read the fisrt line as a string
- split this string at each ',' ; it returns a list containing all the numbers as strings
- convert all elements of that list into int
- print the sum of the list divided by the length of the list
ahhh..... you'll need to use regular expression --"findall" .... sample data would be useful.
What have you been able to do so far?
I've had a go and managed to get it done in three lines of code (four if you include the import re statement) it's easier than you think.
Two lines of code if you import statistics module too.