After reading your code again I see that currently it is not using embedded cursors like I thought it was (although you edited the code at some point and I may have seen embedded cursors in a previous version of the code). You probably can still benefit from the Cursor and Dictionary approach, since most likely once you get this working you probably intend to process many more records and use many more SQL statements than your current code shows. In any case, if your full code actually includes embedded cursors, you should remove the embedded cursors and use the principles my Blog outlined.
In any case, your looping structure appears to reset the distance summation and record counter variables (SUMDISTANCE and C) for each feature class, Since you only write after processing the entire loop, the variables will have been reset so that only the record(s) of the last feature class will be in the average. I don't think that is what you want to do (but I still don't know what this code is supposed to average).
If you mean to aggregate and average records across multiple feature classes then the summation and counter variable should be outside the loops. Alternatively, the write operation perhaps should be inside the loops if multiple averages are actually supposed to be written. Because you set a filter on the SearchCursor to only read FID=0, which should only be one record, probably only one record from the last feature class is being included in the average. So that explains why only the last value in your list is being reported, which I believe is what you showed in one post that you added and then deleted at some point. You need to add that post back, since none of the other posts you have in this thread actually show the numbers you think your are averaging and the result you are getting.
Since you keep editing the code and example data I am commenting on my posts won't make sense to most people reading this thread, since the things I am commenting on disappear and I lose track of what I was seeing. To avoid that confusion, please add new versions of your code and examples in new posts rather than editing posts we have already commented on until your problem is found and resolved.
Your code should probably look like the code below if you only intend to write one AVGDISTANCE value at the end of the loops (the fields list never changes, so that line has been removed from the loop to avoid processing it repeatedly).
SUMDISTANCE = 0
C = 0
fields = ['DISTANCE', 'DURATION']
cases = ['RCs4s3s2c10_S', 'RCs4s3s2c20_S', 'RCs4s3s2c30_S', 'RCs4s3s2c40_S']
for fc in arcpy.ListFeatureClasses():
for case in cases:
if fc.startswith(case):
with arcpy.da.SearchCursor(fc, fields, "FID = 0") as cursor:
for row in cursor:
DISTANCE = row[0]
DURATION = row[1]
SUMDISTANCE += DISTANCE
C += 1
AVGDISTANCE = SUMDISTANCE / C
outFile.write('' + str(AVGDISTANCE) + '\n')
I assume the code you have posted was edited from a longer script or includes code you intend to extend, since although the Duration field is stored in a variable, its value is overwritten in each loop and the values are never actually used.