# Exercise 2:
# 일단은 좋은 코드로 보임 ! **
fname = input("Enter file name: ")
fh = open(fname)
count = 0
plus = 0
for line in fh:
    if not line.startswith("X-DSPAM-Confidence:"):
        continue
    else:
        colon = line.find(':')
        num = line[colon+1:]
        value = float(num)
        plus = plus + value
        count = count + 1
        average = plus / count


print('Average spam confidence:', average)


c902e1ba8a9998fb8f5914eab4aeec23cf47ffc8
<mask token>

<mask token>
for line in fh:
    if not line.startswith('X-DSPAM-Confidence:'):
        continue
    else:
        colon = line.find(':')
        num = line[colon + 1:]
        value = float(num)
        plus = plus + value
        count = count + 1
        average = plus / count
print('Average spam confidence:', average)

fname = input('Enter file name: ')
fh = open(fname)
count = 0
plus = 0
for line in fh:
    if not line.startswith('X-DSPAM-Confidence:'):
        continue
    else:
        colon = line.find(':')
        num = line[colon + 1:]
        value = float(num)
        plus = plus + value
        count = count + 1
        average = plus / count
print('Average spam confidence:', average)

# Exercise 2:
# 일단은 좋은 코드로 보임 ! **
fname = input("Enter file name: ")
fh = open(fname)
count = 0
plus = 0
for line in fh:
    if not line.startswith("X-DSPAM-Confidence:"):
        continue
    else:
        colon = line.find(':')
        num = line[colon+1:]
        value = float(num)
        plus = plus + value
        count = count + 1
        average = plus / count


print('Average spam confidence:', average)

